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_ID3V2FRAMEFACTORY_H
00027 #define TAGLIB_ID3V2FRAMEFACTORY_H
00028
00029 #include "taglib_export.h"
00030 #include "tbytevector.h"
00031 #include "id3v2frame.h"
00032 #include "id3v2header.h"
00033
00034 namespace TagLib {
00035
00036 namespace ID3v2 {
00037
00038 class TextIdentificationFrame;
00039
00041
00065 class TAGLIB_EXPORT FrameFactory
00066 {
00067 public:
00068 static FrameFactory *instance();
00077 Frame *createFrame(const ByteVector &data, bool synchSafeInts) const;
00078
00087 Frame *createFrame(const ByteVector &data, uint version = 4) const;
00088
00093
00094 Frame *createFrame(const ByteVector &data, Header *tagHeader) const;
00095
00101
00102 void rebuildAggregateFrames(ID3v2::Tag *tag) const;
00103
00113 String::Type defaultTextEncoding() const;
00114
00124 void setDefaultTextEncoding(String::Type encoding);
00125
00126 protected:
00131 FrameFactory();
00132
00136 virtual ~FrameFactory();
00137
00149 virtual bool updateFrame(Frame::Header *header) const;
00150
00151 private:
00152 FrameFactory(const FrameFactory &);
00153 FrameFactory &operator=(const FrameFactory &);
00154
00160 void convertFrame(const char *from, const char *to,
00161 Frame::Header *header) const;
00162
00163 void updateGenre(TextIdentificationFrame *frame) const;
00164
00165 static FrameFactory factory;
00166
00167 class FrameFactoryPrivate;
00168 FrameFactoryPrivate *d;
00169 };
00170
00171 }
00172 }
00173
00174 #endif