id3v2tag.h
Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022 #ifndef TAGLIB_ID3V2TAG_H
00023 #define TAGLIB_ID3V2TAG_H
00024
00025 #include <tag.h>
00026 #include <tbytevector.h>
00027 #include <tstring.h>
00028 #include <tlist.h>
00029 #include <tmap.h>
00030
00031 #include "id3v2framefactory.h"
00032
00033 namespace TagLib {
00034
00035 class File;
00036
00038
00046 namespace ID3v2 {
00047
00048 class Header;
00049 class ExtendedHeader;
00050 class Footer;
00051
00052 typedef List<Frame *> FrameList;
00053 typedef Map<ByteVector, FrameList> FrameListMap;
00054
00056
00100 class Tag : public TagLib::Tag
00101 {
00102 public:
00108 Tag();
00109
00122 Tag(File *file, long tagOffset,
00123 const FrameFactory *factory = FrameFactory::instance());
00124
00128 virtual ~Tag();
00129
00130
00131
00132 virtual String title() const;
00133 virtual String artist() const;
00134 virtual String album() const;
00135 virtual String comment() const;
00136 virtual String genre() const;
00137 virtual uint year() const;
00138 virtual uint track() const;
00139
00140 virtual void setTitle(const String &s);
00141 virtual void setArtist(const String &s);
00142 virtual void setAlbum(const String &s);
00143 virtual void setComment(const String &s);
00144 virtual void setGenre(const String &s);
00145 virtual void setYear(uint i);
00146 virtual void setTrack(uint i);
00147
00148 virtual bool isEmpty() const;
00149
00153 Header *header() const;
00154
00159 ExtendedHeader *extendedHeader() const;
00160
00169 Footer *footer() const;
00170
00205 const FrameListMap &frameListMap() const;
00206
00217 const FrameList &frameList() const;
00218
00230 const FrameList &frameList(const ByteVector &frameID) const;
00231
00239 void addFrame(Frame *frame);
00240
00248 void removeFrame(Frame *frame, bool del = true);
00249
00256 void removeFrames(const ByteVector &id);
00257
00261 ByteVector render() const;
00262
00263 protected:
00270 void read();
00271
00276 void parse(const ByteVector &data);
00277
00282 void setTextFrame(const ByteVector &id, const String &value);
00283
00284 private:
00285 Tag(const Tag &);
00286 Tag &operator=(const Tag &);
00287
00288 class TagPrivate;
00289 TagPrivate *d;
00290 };
00291
00292 }
00293 }
00294
00295 #endif