TagLib  1.13.1
apeitem.h
Go to the documentation of this file.
1 /***************************************************************************
2  copyright : (C) 2004 by Allan Sandfeld Jensen
3  email : kde@carewolf.org
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_APEITEM_H
27 #define TAGLIB_APEITEM_H
28 
29 #include "tbytevector.h"
30 #include "tstring.h"
31 #include "tstringlist.h"
32 
33 namespace TagLib {
34  namespace APE {
36 
41  {
42  public:
46  enum ItemTypes {
48  Text = 0,
50  Binary = 1,
52  Locator = 2
53  };
57  Item();
58 
62  // BIC: Remove this, StringList has a constructor from a single string
63  Item(const String &key, const String &value);
64 
68  Item(const String &key, const StringList &values);
69 
74  Item(const String &key, const ByteVector &value, bool binary);
75 
79  Item(const Item &item);
80 
84  virtual ~Item();
85 
89  Item &operator=(const Item &item);
90 
94  void swap(Item &item);
95 
99  String key() const;
100 
105  ByteVector binaryData() const;
106 
111  void setBinaryData(const ByteVector &value);
112 
113 #ifndef DO_NOT_DOCUMENT
114  /* Remove in next binary incompatible release */
115  ByteVector value() const;
116 #endif
117 
121  void setKey(const String &key);
122 
128  void setValue(const String &value);
129 
136  void setValues(const StringList &values);
137 
143  void appendValue(const String &value);
144 
150  void appendValues(const StringList &values);
151 
155  int size() const;
156 
162  String toString() const;
163 
164 #ifndef DO_NOT_DOCUMENT
165  /* Remove in next binary incompatible release */
166  StringList toStringList() const;
167 #endif
168 
173  StringList values() const;
174 
178  ByteVector render() const;
179 
183  void parse(const ByteVector& data);
184 
188  void setReadOnly(bool readOnly);
189 
193  bool isReadOnly() const;
194 
200  void setType(ItemTypes type);
201 
205  ItemTypes type() const;
206 
210  bool isEmpty() const;
211 
212  private:
213  class ItemPrivate;
214  ItemPrivate *d;
215  };
216  } // namespace APE
217 } // namespace TagLib
218 
219 #endif
A wide string class suitable for unicode.
Definition: tstring.h:84
A byte vector.
Definition: tbytevector.h:45
A list of strings.
Definition: tstringlist.h:45
#define TAGLIB_EXPORT
Definition: taglib_export.h:40
An implementation of APE-items.
Definition: apeitem.h:40
ItemTypes
Definition: apeitem.h:46
A namespace for all TagLib related classes and functions.
Definition: apefile.h:41