TagLib  2.2.1
apetag.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_APETAG_H
27 #define TAGLIB_APETAG_H
28 
29 #include "tbytevector.h"
30 #include "tmap.h"
31 #include "tstring.h"
32 #include "taglib.h"
33 #include "taglib_export.h"
34 #include "tag.h"
35 #include "apeitem.h"
36 
37 namespace TagLib {
38 
39  class File;
40 
42 
43  namespace APE {
44 
45  class Footer;
46 
53 
55 
56  class TAGLIB_EXPORT Tag : public TagLib::Tag
57  {
58  public:
62  Tag();
63 
68  Tag(TagLib::File *file, offset_t footerLocation);
69 
73  ~Tag() override;
74 
75  Tag(const Tag &) = delete;
76  Tag &operator=(const Tag &) = delete;
77 
82  ByteVector render() const;
83 
88  static ByteVector fileIdentifier();
89 
90  // Reimplementations.
91 
92  String title() const override;
93  String artist() const override;
94  String album() const override;
95  String comment() const override;
96  String genre() const override;
97  unsigned int year() const override;
98  unsigned int track() const override;
99 
100  void setTitle(const String &s) override;
101  void setArtist(const String &s) override;
102  void setAlbum(const String &s) override;
103  void setComment(const String &s) override;
104  void setGenre(const String &s) override;
105  void setYear(unsigned int i) override;
106  void setTrack(unsigned int i) override;
107 
123  PropertyMap properties() const override;
124 
125  void removeUnsupportedProperties(const StringList &properties) override;
126 
133  PropertyMap setProperties(const PropertyMap &) override;
134 
135  StringList complexPropertyKeys() const override;
136  List<VariantMap> complexProperties(const String &key) const override;
137  bool setComplexProperties(const String &key, const List<VariantMap> &value) override;
138 
142  static bool checkKey(const String&);
143 
147  Footer *footer() const;
148 
161  const ItemListMap &itemListMap() const;
162 
166  void removeItem(const String &key);
167 
173  void addValue(const String &key, const String &value, bool replace = true);
174 
180  void setData(const String &key, const ByteVector &value);
181 
186  void setItem(const String &key, const Item &item);
187 
191  bool isEmpty() const override;
192 
193  protected:
194 
198  void read();
199 
203  void parse(const ByteVector &data);
204 
205  private:
206  class TagPrivate;
208  std::unique_ptr<TagPrivate> d;
209  };
210  } // namespace APE
211 } // namespace TagLib
212 
213 #endif
A generic, implicitly shared list.
Definition: tlist.h:53
An APE tag implementation.
Definition: apetag.h:56
A map for format-independent <key,values> tag representations.
Definition: tpropertymap.h:122
A simple, generic interface to common audio metadata fields.
Definition: tag.h:48
A file class with some useful methods for tag manipulation.
Definition: tfile.h:50
A wide string class suitable for unicode.
Definition: tstring.h:82
An implementation of APE footers.
Definition: apefooter.h:45
A byte vector.
Definition: tbytevector.h:45
#define TAGLIB_MSVC_SUPPRESS_WARNING_NEEDS_TO_HAVE_DLL_INTERFACE
Definition: taglib_export.h:55
A generic, implicitly shared map.
Definition: tmap.h:44
A list of strings.
Definition: tstringlist.h:43
#define TAGLIB_EXPORT
Definition: taglib_export.h:40
An implementation of APE-items.
Definition: apeitem.h:40
String TAGLIB_EXPORT genre(int index)
off_t offset_t
Definition: taglib.h:64
A namespace for all TagLib related classes and functions.
Definition: apefile.h:41