asfattribute.h
Go to the documentation of this file.
1 /**************************************************************************
2  copyright : (C) 2005-2007 by Lukáš Lalinský
3  email : lalinsky@gmail.com
4  **************************************************************************/
5 
6 /***************************************************************************
7  * This library is free software; you can redistribute it and/or modify *
8  * it under the terms of the GNU Lesser General Public License version *
9  * 2.1 as published by the Free Software Foundation. *
10  * *
11  * This library is distributed in the hope that it will be useful, but *
12  * WITHOUT ANY WARRANTY; without even the implied warranty of *
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
14  * Lesser General Public License for more details. *
15  * *
16  * You should have received a copy of the GNU Lesser General Public *
17  * License along with this library; if not, write to the Free Software *
18  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA *
19  * 02110-1301 USA *
20  * *
21  * Alternatively, this file is available under the Mozilla Public *
22  * License Version 1.1. You may obtain a copy of the License at *
23  * http://www.mozilla.org/MPL/ *
24  ***************************************************************************/
25 
26 #ifndef TAGLIB_ASFATTRIBUTE_H
27 #define TAGLIB_ASFATTRIBUTE_H
28 
29 #include "tstring.h"
30 #include "tbytevector.h"
31 #include "taglib_export.h"
32 #include "asfpicture.h"
33 
34 namespace TagLib
35 {
36 
37  namespace ASF
38  {
39 
40  class File;
41  class Picture;
42 
44  {
45  public:
46 
51  UnicodeType = 0,
52  BytesType = 1,
53  BoolType = 2,
54  DWordType = 3,
55  QWordType = 4,
56  WordType = 5,
57  GuidType = 6
58  };
59 
63  Attribute();
64 
68  Attribute(const String &value);
69 
73  Attribute(const ByteVector &value);
74 
86  Attribute(const Picture &value);
87 
91  Attribute(unsigned int value);
92 
96  Attribute(unsigned long long value);
97 
101  Attribute(unsigned short value);
102 
106  Attribute(bool value);
107 
111  Attribute(const Attribute &item);
112 
116  ASF::Attribute &operator=(const Attribute &other);
117 
121  void swap(Attribute &other);
122 
126  virtual ~Attribute();
127 
131  AttributeTypes type() const;
132 
136  unsigned short toBool() const;
137 
141  unsigned short toUShort() const;
142 
146  unsigned int toUInt() const;
147 
151  unsigned long long toULongLong() const;
152 
156  String toString() const;
157 
161  ByteVector toByteVector() const;
162 
166  Picture toPicture() const;
167 
171  int language() const;
172 
176  void setLanguage(int value);
177 
181  int stream() const;
182 
186  void setStream(int value);
187 
188 #ifndef DO_NOT_DOCUMENT
189  /* THIS IS PRIVATE, DON'T TOUCH IT! */
190  String parse(ASF::File &file, int kind = 0);
191 #endif
192 
194  int dataSize() const;
195 
196  private:
197  friend class File;
198 
199  ByteVector render(const String &name, int kind = 0) const;
200 
201  class AttributePrivate;
202  AttributePrivate *d;
203  };
204  }
205 
206 }
207 
208 #endif
A wide string class suitable for unicode.
Definition: tstring.h:84
A byte vector.
Definition: tbytevector.h:45
An ASF attached picture interface implementation.
Definition: asfpicture.h:49
#define TAGLIB_EXPORT
Definition: taglib_export.h:40
AttributeTypes
Definition: asfattribute.h:50
Definition: asffile.h:46
TAGLIB_EXPORT unsigned int toUInt(const ByteVector &data)
Definition: asfattribute.h:43