TagLib  1.13
id3v2tag.h
Go to the documentation of this file.
1/***************************************************************************
2 copyright : (C) 2002 - 2008 by Scott Wheeler
3 email : wheeler@kde.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_ID3V2TAG_H
27#define TAGLIB_ID3V2TAG_H
28
29#include "tag.h"
30#include "tbytevector.h"
31#include "tstring.h"
32#include "tlist.h"
33#include "tmap.h"
34#include "taglib_export.h"
35
36#include "id3v2.h"
37#include "id3v2framefactory.h"
38
39namespace TagLib {
40
41 class File;
42
43 namespace ID3v2 {
44
45 class Header;
46 class ExtendedHeader;
47 class Footer;
48
51
53
70 {
71 public:
74
79 virtual String parse(const ByteVector &data) const;
80 };
81
83
128 {
129 public:
136
149 Tag(File *file, long tagOffset,
150 const FrameFactory *factory = FrameFactory::instance());
151
155 virtual ~Tag();
156
157 // Reimplementations.
158
159 virtual String title() const;
160 virtual String artist() const;
161 virtual String album() const;
162 virtual String comment() const;
163 virtual String genre() const;
164 virtual unsigned int year() const;
165 virtual unsigned int track() const;
166
167 virtual void setTitle(const String &s);
168 virtual void setArtist(const String &s);
169 virtual void setAlbum(const String &s);
170 virtual void setComment(const String &s);
171 virtual void setGenre(const String &s);
172 virtual void setYear(unsigned int i);
173 virtual void setTrack(unsigned int i);
174
175 virtual bool isEmpty() const;
176
180 Header *header() const;
181
187
197
233
244 const FrameList &frameList() const;
245
257 const FrameList &frameList(const ByteVector &frameID) const;
258
266 void addFrame(Frame *frame);
267
275 void removeFrame(Frame *frame, bool del = true);
276
283 void removeFrames(const ByteVector &id);
284
315
328
334
339
344
351 ByteVector render(Version version) const;
352
360
372 static void setLatin1StringHandler(const Latin1StringHandler *handler);
373
374 protected:
381 void read();
382
387 void parse(const ByteVector &data);
388
393 void setTextFrame(const ByteVector &id, const String &value);
394
398 void downgradeFrames(FrameList *existingFrames, FrameList *newFrames) const;
399
400 private:
401 Tag(const Tag &);
402 Tag &operator=(const Tag &);
403
404 class TagPrivate;
405 TagPrivate *d;
406 };
407
408 }
409}
410
411#endif
A byte vector.
Definition: tbytevector.h:46
A file class with some useful methods for tag manipulation.
Definition: tfile.h:51
ID3v2 extended header implementation.
Definition: id3v2extendedheader.h:49
ID3v2 footer implementation.
Definition: id3v2footer.h:51
A factory for creating ID3v2 frames during parsing.
Definition: id3v2framefactory.h:66
static FrameFactory * instance()
ID3v2 frame implementation.
Definition: id3v2frame.h:55
An implementation of ID3v2 headers.
Definition: id3v2header.h:49
An abstraction for the ISO-8859-1 string to data encoding in ID3v2 tags.
Definition: id3v2tag.h:70
virtual String parse(const ByteVector &data) const
The main class in the ID3v2 implementation.
Definition: id3v2tag.h:128
virtual String artist() const
virtual void setGenre(const String &s)
virtual void setComment(const String &s)
TAGLIB_DEPRECATED Footer * footer() const
void removeFrame(Frame *frame, bool del=true)
virtual String genre() const
void downgradeFrames(FrameList *existingFrames, FrameList *newFrames) const
static Latin1StringHandler const * latin1StringHandler()
ExtendedHeader * extendedHeader() const
virtual void setAlbum(const String &s)
virtual void setTitle(const String &s)
virtual unsigned int year() const
PropertyMap properties() const
TAGLIB_DEPRECATED ByteVector render(int version) const
virtual void setTrack(unsigned int i)
static void setLatin1StringHandler(const Latin1StringHandler *handler)
void removeUnsupportedProperties(const StringList &properties)
void removeFrames(const ByteVector &id)
void parse(const ByteVector &data)
ByteVector render() const
virtual String album() const
Header * header() const
const FrameListMap & frameListMap() const
const FrameList & frameList() const
Tag(File *file, long tagOffset, const FrameFactory *factory=FrameFactory::instance())
ByteVector render(Version version) const
void setTextFrame(const ByteVector &id, const String &value)
const FrameList & frameList(const ByteVector &frameID) const
virtual String title() const
PropertyMap setProperties(const PropertyMap &)
void addFrame(Frame *frame)
virtual bool isEmpty() const
virtual unsigned int track() const
virtual void setYear(unsigned int i)
virtual String comment() const
virtual void setArtist(const String &s)
A generic, implicitly shared list.
Definition: tlist.h:54
A generic, implicitly shared map.
Definition: tmap.h:44
A map for format-independent <key,valuelist> tag representations.
Definition: tpropertymap.h:119
A list of strings.
Definition: tstringlist.h:46
A wide string class suitable for unicode.
Definition: tstring.h:85
Definition: tag.h:47
List< Frame * > FrameList
Definition: id3v2tag.h:47
Map< ByteVector, FrameList > FrameListMap
Definition: id3v2tag.h:50
Version
Definition: id3v2.h:17
A namespace for all TagLib related classes and functions.
Definition: apefile.h:41
#define TAGLIB_DEPRECATED
Definition: taglib.h:54
#define TAGLIB_EXPORT
Definition: taglib_export.h:40