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., 51 Franklin Street, Fifth Floor, Boston, MA         *
00019  *   02110-1301  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 #include "asfpicture.h"
00033 
00034 namespace TagLib
00035 {
00036 
00037   namespace ASF
00038   {
00039 
00040     class File;
00041     class Picture;
00042 
00043     class TAGLIB_EXPORT Attribute
00044     {
00045     public:
00046 
00050       enum AttributeTypes {
00051         UnicodeType = 0,
00052         BytesType   = 1,
00053         BoolType    = 2,
00054         DWordType   = 3,
00055         QWordType   = 4,
00056         WordType    = 5,
00057         GuidType    = 6
00058       };
00059 
00063       Attribute();
00064 
00068       Attribute(const String &value);
00069 
00073       Attribute(const ByteVector &value);      
00074 
00086       Attribute(const Picture &value);
00087 
00091       Attribute(unsigned int value);
00092 
00096       Attribute(unsigned long long value);
00097 
00101       Attribute(unsigned short value);
00102 
00106       Attribute(bool value);
00107 
00111       Attribute(const Attribute &item);
00112 
00116       ASF::Attribute &operator=(const Attribute &other);
00117 
00121       virtual ~Attribute();
00122 
00126       AttributeTypes type() const;
00127 
00131       unsigned short toBool() const;
00132 
00136       unsigned short toUShort() const;
00137 
00141       unsigned int toUInt() const;
00142 
00146       unsigned long long toULongLong() const;
00147 
00151       String toString() const;
00152 
00156       ByteVector toByteVector() const;
00157 
00161       Picture toPicture() const;
00162 
00166       int language() const;
00167 
00171       void setLanguage(int value);
00172 
00176       int stream() const;
00177 
00181       void setStream(int value);
00182 
00183 #ifndef DO_NOT_DOCUMENT
00184       /* THIS IS PRIVATE, DON'T TOUCH IT! */
00185       String parse(ASF::File &file, int kind = 0);
00186 #endif
00187 
00189       int dataSize() const;
00190 
00191     private:
00192       friend class File;
00193 
00194       ByteVector render(const String &name, int kind = 0) const;
00195 
00196       class AttributePrivate;
00197       AttributePrivate *d;
00198     };
00199   }
00200 
00201 }
00202 
00203 #endif