| TagLib 1.13 |  |

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 "tag.h"
30#include "tmap.h"
31#include "tstring.h"
32#include "tstringlist.h"
33#include "tbytevector.h"
34#include "taglib_export.h"
35
36 namespace TagLib {
37
38 class File;
39
41 namespace RIFF {
42 namespace Info {
43
44 typedef Map<ByteVector, String> FieldListMap;
45
47
60 class TAGLIB_EXPORT StringHandler
61 {
62 public:
63 StringHandler();
64 ~StringHandler();
65
70 virtual String parse(const ByteVector &data) const;
71
76 virtual ByteVector render(const String &s) const;
77 };
78
80
88 class TAGLIB_EXPORT Tag : public TagLib::Tag
89 {
90 public:
94 Tag();
95
99 Tag(const ByteVector &data);
100
101 virtual ~Tag();
102
103 // Reimplementations
104
105 virtual String title() const;
106 virtual String artist() const;
107 virtual String album() const;
108 virtual String comment() const;
109 virtual String genre() const;
110 virtual unsigned int year() const;
111 virtual unsigned int track() const;
112
113 virtual void setTitle(const String &s);
114 virtual void setArtist(const String &s);
115 virtual void setAlbum(const String &s);
116 virtual void setComment(const String &s);
117 virtual void setGenre(const String &s);
118 virtual void setYear(unsigned int i);
119 virtual void setTrack(unsigned int i);
120
121 virtual bool isEmpty() const;
122
133 FieldListMap fieldListMap() const;
134
135 /*
136 * Gets the value of the field with the ID \a id.
137 */
138 String fieldText(const ByteVector &id) const;
139
140 /*
141 * Sets the value of the field with the ID \a id to \a s.
142 * If the field does not exist, it is created.
143 * If \s is empty, the field is removed.
144 *
145 * \note fieldId must be four-byte long pure ASCII string. This function
146 * performs nothing if fieldId is invalid.
147 */
148 void setFieldText(const ByteVector &id, const String &s);
149
150 /*
151 * Removes the field with the ID \a id.
152 */
153 void removeField(const ByteVector &id);
154
160 ByteVector render() const;
161
173 static void setStringHandler(const StringHandler *handler);
174
175 protected:
179 void parse(const ByteVector &data);
180
181
182 private:
183 Tag(const Tag &);
184 Tag &operator=(const Tag &);
185
186 class TagPrivate;
187 TagPrivate *d;
188 };
189 }}
190}
191
192#endif
TagLib::ByteVector
A byte vector.
Definition: tbytevector.h:46
TagLib::Map
A generic, implicitly shared map.
Definition: tmap.h:44
TagLib::RIFF::Info::StringHandler
A abstraction for the string to data encoding in Info tags.
Definition: infotag.h:61
TagLib::RIFF::Info::StringHandler::parse
virtual String parse(const ByteVector &data) const
TagLib::RIFF::Info::StringHandler::render
virtual ByteVector render(const String &s) const
TagLib::RIFF::Info::StringHandler::StringHandler
StringHandler()
TagLib::RIFF::Info::StringHandler::~StringHandler
~StringHandler()
TagLib::RIFF::Info::Tag
The main class in the ID3v2 implementation.
Definition: infotag.h:89
TagLib::RIFF::Info::Tag::setAlbum
virtual void setAlbum(const String &s)
TagLib::RIFF::Info::Tag::render
ByteVector render() const
TagLib::RIFF::Info::Tag::~Tag
virtual ~Tag()
TagLib::RIFF::Info::Tag::genre
virtual String genre() const
TagLib::RIFF::Info::Tag::setArtist
virtual void setArtist(const String &s)
TagLib::RIFF::Info::Tag::title
virtual String title() const
TagLib::RIFF::Info::Tag::fieldListMap
FieldListMap fieldListMap() const
TagLib::RIFF::Info::Tag::removeField
void removeField(const ByteVector &id)
TagLib::RIFF::Info::Tag::setTitle
virtual void setTitle(const String &s)
TagLib::RIFF::Info::Tag::artist
virtual String artist() const
TagLib::RIFF::Info::Tag::isEmpty
virtual bool isEmpty() const
TagLib::RIFF::Info::Tag::album
virtual String album() const
TagLib::RIFF::Info::Tag::fieldText
String fieldText(const ByteVector &id) const
TagLib::RIFF::Info::Tag::setGenre
virtual void setGenre(const String &s)
TagLib::RIFF::Info::Tag::setTrack
virtual void setTrack(unsigned int i)
TagLib::RIFF::Info::Tag::year
virtual unsigned int year() const
TagLib::RIFF::Info::Tag::comment
virtual String comment() const
TagLib::RIFF::Info::Tag::setFieldText
void setFieldText(const ByteVector &id, const String &s)
TagLib::RIFF::Info::Tag::parse
void parse(const ByteVector &data)
TagLib::RIFF::Info::Tag::setComment
virtual void setComment(const String &s)
TagLib::RIFF::Info::Tag::setStringHandler
static void setStringHandler(const StringHandler *handler)
TagLib::RIFF::Info::Tag::setYear
virtual void setYear(unsigned int i)
TagLib::RIFF::Info::Tag::Tag
Tag()
TagLib::RIFF::Info::Tag::track
virtual unsigned int track() const
TagLib::RIFF::Info::Tag::Tag
Tag(const ByteVector &data)
TagLib::String
A wide string class suitable for unicode.
Definition: tstring.h:85
TagLib::Tag
Definition: tag.h:47
TagLib::RIFF::Info::FieldListMap
Map< ByteVector, String > FieldListMap
Definition: infotag.h:44
TagLib
A namespace for all TagLib related classes and functions.
Definition: apefile.h:41
tag.h
taglib_export.h
TAGLIB_EXPORT
#define TAGLIB_EXPORT
Definition: taglib_export.h:40
tbytevector.h
tmap.h
tstring.h
tstringlist.h