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
00023
00024
00025
00026 #ifndef TAGLIB_ID3V2TAG_H
00027 #define TAGLIB_ID3V2TAG_H
00028
00029 #include "tag.h"
00030 #include "tbytevector.h"
00031 #include "tstring.h"
00032 #include "tlist.h"
00033 #include "tmap.h"
00034 #include "taglib_export.h"
00035
00036 #include "id3v2framefactory.h"
00037
00038 namespace TagLib {
00039
00040 class File;
00041
00043
00051 namespace ID3v2 {
00052
00053 class Header;
00054 class ExtendedHeader;
00055 class Footer;
00056
00057 typedef List<Frame *> FrameList;
00058 typedef Map<ByteVector, FrameList> FrameListMap;
00059
00061
00105 class TAGLIB_EXPORT Tag : public TagLib::Tag
00106 {
00107 public:
00113 Tag();
00114
00127 Tag(File *file, long tagOffset,
00128 const FrameFactory *factory = FrameFactory::instance());
00129
00133 virtual ~Tag();
00134
00135
00136
00137 virtual String title() const;
00138 virtual String artist() const;
00139 virtual String album() const;
00140 virtual String comment() const;
00141 virtual String genre() const;
00142 virtual uint year() const;
00143 virtual uint track() const;
00144
00145 virtual void setTitle(const String &s);
00146 virtual void setArtist(const String &s);
00147 virtual void setAlbum(const String &s);
00148 virtual void setComment(const String &s);
00149 virtual void setGenre(const String &s);
00150 virtual void setYear(uint i);
00151 virtual void setTrack(uint i);
00152
00153 virtual bool isEmpty() const;
00154
00158 Header *header() const;
00159
00164 ExtendedHeader *extendedHeader() const;
00165
00174 Footer *footer() const;
00175
00210 const FrameListMap &frameListMap() const;
00211
00222 const FrameList &frameList() const;
00223
00235 const FrameList &frameList(const ByteVector &frameID) const;
00236
00244 void addFrame(Frame *frame);
00245
00253 void removeFrame(Frame *frame, bool del = true);
00254
00261 void removeFrames(const ByteVector &id);
00262
00266 ByteVector render() const;
00267
00268 protected:
00275 void read();
00276
00281 void parse(const ByteVector &data);
00282
00287 void setTextFrame(const ByteVector &id, const String &value);
00288
00289 private:
00290 Tag(const Tag &);
00291 Tag &operator=(const Tag &);
00292
00293 class TagPrivate;
00294 TagPrivate *d;
00295 };
00296
00297 }
00298 }
00299
00300 #endif