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
00027
00028 #ifndef _ID3LIB_FIELD_H_
00029 #define _ID3LIB_FIELD_H_
00030
00031 #include <id3/globals.h>
00032
00033 class ID3_Reader;
00034 class ID3_Writer;
00035
00036 class ID3_CPP_EXPORT ID3_Field
00037 {
00038 public:
00039 virtual void Clear() = 0;
00040
00041 virtual size_t Size() const = 0;
00042 virtual size_t BinSize() const = 0;
00043 virtual size_t GetNumTextItems() const = 0;
00044
00045
00046 virtual ID3_Field& operator= (uint32 val) = 0;
00047 virtual void Set(uint32) = 0;
00048 virtual uint32 Get() const = 0;
00049
00050
00051 virtual ID3_Field& operator= (const char* s) = 0;
00052 virtual size_t Set(const char*) = 0;
00053 virtual size_t Get(char*, size_t) const = 0;
00054 virtual size_t Get(char*, size_t, index_t) const = 0;
00055 virtual const char* GetRawText() const = 0;
00056 virtual const char* GetRawTextItem(index_t) const = 0;
00057 virtual size_t Add(const char*) = 0;
00058
00059
00060 virtual ID3_Field& operator= (const unicode_t* s) = 0;
00061 virtual size_t Set(const unicode_t*) = 0;
00062 virtual size_t Get(unicode_t *buffer, size_t) const = 0;
00063 virtual size_t Get(unicode_t *buffer, size_t, index_t) const = 0;
00064 virtual const unicode_t* GetRawUnicodeText() const = 0;
00065 virtual const unicode_t* GetRawUnicodeTextItem(index_t) const = 0;
00066 virtual size_t Add(const unicode_t*) = 0;
00067
00068
00069 virtual size_t Set(const uchar*, size_t) = 0;
00070 virtual size_t Get(uchar*, size_t) const = 0;
00071 virtual const uchar* GetRawBinary() const = 0;
00072 virtual void FromFile(const char*) = 0;
00073 virtual void ToFile(const char *sInfo) const = 0;
00074
00075
00076 virtual ID3_Field& operator=( const ID3_Field & ) = 0;
00077 virtual bool InScope(ID3_V2Spec spec) const = 0;
00078
00079 virtual ID3_FieldID GetID() const = 0;
00080 virtual ID3_FieldType GetType() const = 0;
00081 virtual bool SetEncoding(ID3_TextEnc enc) = 0;
00082 virtual ID3_TextEnc GetEncoding() const = 0;
00083 virtual bool IsEncodable() const = 0;
00084
00085 virtual void Render(ID3_Writer&) const = 0;
00086 virtual bool Parse(ID3_Reader&) = 0;
00087 virtual bool HasChanged() const = 0;
00088
00089 protected:
00090 virtual ~ID3_Field() { };
00091
00092
00093 ID3_Field() { };
00094 };
00095
00096 class ID3_CPP_EXPORT ID3_FrameInfo
00097 {
00098
00099 public:
00100 ID3_FrameInfo() {};
00101 ~ID3_FrameInfo() {};
00102 char *ShortName(ID3_FrameID frameid);
00103 char *LongName(ID3_FrameID frameid);
00104 const char *Description(ID3_FrameID frameid);
00105 int MaxFrameID();
00106 int NumFields(ID3_FrameID frameid);
00107 ID3_FieldType FieldType(ID3_FrameID frameid, int fieldnum);
00108 size_t FieldSize(ID3_FrameID frameid, int fieldnum);
00109 flags_t FieldFlags(ID3_FrameID frameid, int fieldnum);
00110 };
00111
00112 #endif