TagLib API Documentation
infotag.h
Go to the documentation of this file.
1/***************************************************************************
2 copyright : (C) 2012 by Tsuda Kageyu
3 email : tsuda.kageyu@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_INFOTAG_H
27#define TAGLIB_INFOTAG_H
28
29#include "tmap.h"
30#include "tstring.h"
31#include "tbytevector.h"
32#include "taglib_export.h"
33#include "tag.h"
34
35namespace TagLib {
36
37 class File;
38
39 namespace RIFF {
41 namespace Info {
42
44
46
60 {
61 public:
63 virtual ~StringHandler();
64
65 StringHandler(const StringHandler &) = delete;
67
72 virtual String parse(const ByteVector &data) const;
73
78 virtual ByteVector render(const String &s) const;
79
80 private:
81 class StringHandlerPrivate;
83 std::unique_ptr<StringHandlerPrivate> d;
84 };
85
87
96 {
97 public:
102
106 Tag(const ByteVector &data);
107
108 ~Tag() override;
109
110 Tag(const Tag &) = delete;
111 Tag &operator=(const Tag &) = delete;
112
113 // Reimplementations
114
115 String title() const override;
116 String artist() const override;
117 String album() const override;
118 String comment() const override;
119 String genre() const override;
120 unsigned int year() const override;
121 unsigned int track() const override;
122
123 void setTitle(const String &s) override;
124 void setArtist(const String &s) override;
125 void setAlbum(const String &s) override;
126 void setComment(const String &s) override;
127 void setGenre(const String &s) override;
128 void setYear(unsigned int i) override;
129 void setTrack(unsigned int i) override;
130
131 bool isEmpty() const override;
132
133 PropertyMap properties() const override;
134 void removeUnsupportedProperties(const StringList &props) override;
135 PropertyMap setProperties(const PropertyMap &props) override;
136
148
152 String fieldText(const ByteVector &id) const;
153
162 void setFieldText(const ByteVector &id, const String &s);
163
167 void removeField(const ByteVector &id);
168
175
187 static void setStringHandler(const StringHandler *handler);
188
189 protected:
193 void parse(const ByteVector &data);
194
195 private:
196 class TagPrivate;
198 std::unique_ptr<TagPrivate> d;
199 };
200 } // namespace Info
201} // namespace RIFF
202} // namespace TagLib
203
204#endif
A byte vector.
Definition: tbytevector.h:46
A generic, implicitly shared map.
Definition: tmap.h:45
A map for format-independent <key,values> tag representations.
Definition: tpropertymap.h:123
An abstraction for the string to data encoding in Info tags.
Definition: infotag.h:60
virtual String parse(const ByteVector &data) const
StringHandler(const StringHandler &)=delete
virtual ByteVector render(const String &s) const
StringHandler & operator=(const StringHandler &)=delete
The main class in the INFO tag implementation.
Definition: infotag.h:96
ByteVector render() const
void removeUnsupportedProperties(const StringList &props) override
void setTitle(const String &s) override
bool isEmpty() const override
void setTrack(unsigned int i) override
FieldListMap fieldListMap() const
String album() const override
unsigned int year() const override
void removeField(const ByteVector &id)
String artist() const override
String title() const override
void setComment(const String &s) override
String fieldText(const ByteVector &id) const
PropertyMap properties() const override
Tag & operator=(const Tag &)=delete
Tag(const Tag &)=delete
void setAlbum(const String &s) override
void setFieldText(const ByteVector &id, const String &s)
void parse(const ByteVector &data)
static void setStringHandler(const StringHandler *handler)
String comment() const override
void setYear(unsigned int i) override
PropertyMap setProperties(const PropertyMap &props) override
String genre() const override
void setGenre(const String &s) override
void setArtist(const String &s) override
unsigned int track() const override
Tag(const ByteVector &data)
A list of strings.
Definition: tstringlist.h:44
A wide string class suitable for unicode.
Definition: tstring.h:83
A simple, generic interface to common audio metadata fields.
Definition: tag.h:49
A namespace for all TagLib related classes and functions.
Definition: apefile.h:41
#define TAGLIB_EXPORT
Definition: taglib_export.h:40
#define TAGLIB_MSVC_SUPPRESS_WARNING_NEEDS_TO_HAVE_DLL_INTERFACE
Definition: taglib_export.h:55