asfattribute.h

Go to the documentation of this file.
00001 /**************************************************************************
00002     copyright            : (C) 2005-2007 by Lukáš Lalinský
00003     email                : lalinsky@gmail.com
00004  **************************************************************************/
00005 
00006 /***************************************************************************
00007  *   This library is free software; you can redistribute it and/or modify  *
00008  *   it under the terms of the GNU Lesser General Public License version   *
00009  *   2.1 as published by the Free Software Foundation.                     *
00010  *                                                                         *
00011  *   This library is distributed in the hope that it will be useful, but   *
00012  *   WITHOUT ANY WARRANTY; without even the implied warranty of            *
00013  *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU     *
00014  *   Lesser General Public License for more details.                       *
00015  *                                                                         *
00016  *   You should have received a copy of the GNU Lesser General Public      *
00017  *   License along with this library; if not, write to the Free Software   *
00018  *   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  *
00019  *   USA                                                                   *
00020  *                                                                         *
00021  *   Alternatively, this file is available under the Mozilla Public        *
00022  *   License Version 1.1.  You may obtain a copy of the License at         *
00023  *   http://www.mozilla.org/MPL/                                           *
00024  ***************************************************************************/
00025 
00026 #ifndef TAGLIB_ASFATTRIBUTE_H
00027 #define TAGLIB_ASFATTRIBUTE_H
00028 
00029 #include "tstring.h"
00030 #include "tbytevector.h"
00031 #include "taglib_export.h"
00032 
00033 namespace TagLib
00034 {
00035 
00036   namespace ASF
00037   {
00038 
00039     class File;
00040 
00041     class TAGLIB_EXPORT Attribute
00042     {
00043     public:
00044 
00048       enum AttributeTypes {
00049         UnicodeType = 0,
00050         BytesType   = 1,
00051         BoolType    = 2,
00052         DWordType   = 3,
00053         QWordType   = 4,
00054         WordType    = 5,
00055         GuidType    = 6
00056       };
00057 
00061       Attribute();
00062 
00066       Attribute(const String &value);
00067 
00071       Attribute(const ByteVector &value);
00072 
00076       Attribute(unsigned int value);
00077 
00081       Attribute(unsigned long long value);
00082 
00086       Attribute(unsigned short value);
00087 
00091       Attribute(bool value);
00092 
00096       Attribute(const Attribute &item);
00097 
00101       ASF::Attribute &operator=(const Attribute &other);
00102 
00106       virtual ~Attribute();
00107 
00111       AttributeTypes type() const;
00112 
00116       unsigned short toBool() const;
00117 
00121       unsigned short toUShort() const;
00122 
00126       unsigned int toUInt() const;
00127 
00131       unsigned long long toULongLong() const;
00132 
00136       String toString() const;
00137 
00141       ByteVector toByteVector() const;
00142 
00146       int language() const;
00147 
00151       void setLanguage(int value);
00152 
00156       int stream() const;
00157 
00161       void setStream(int value);
00162 
00163 #ifndef DO_NOT_DOCUMENT
00164       /* THIS IS PRIVATE, DON'T TOUCH IT! */
00165       String parse(ASF::File &file, int kind = 0);
00166 #endif
00167 
00168     private:
00169       friend class File;
00170 
00171       ByteVector render(const String &name, int kind = 0) const;
00172 
00173       class AttributePrivate;
00174       AttributePrivate *d;
00175     };
00176 
00177   }
00178 
00179 }
00180 
00181 #endif