#include <field_impl.h>
Inheritance diagram for ID3_FieldImpl::
Public Methods | |
~ID3_FieldImpl () | |
void | Clear () |
Clears any data and frees any memory associated with the field. More... | |
size_t | Size () const |
Returns the size of a field. More... | |
size_t | BinSize () const |
size_t | GetNumTextItems () const |
Returns the number of items in a text list. More... | |
ID3_Field & | operator= (uint32 val) |
A shortcut for the Set method. More... | |
void | Set (uint32) |
Sets the value of the field to the specified integer. More... | |
uint32 | Get () const |
Returns the value of the integer field. More... | |
void | SetInteger (uint32) |
uint32 | GetInteger () const |
ID3_Field & | operator= (const char *s) |
Shortcut for the Set operator. More... | |
size_t | Set (const char *data) |
Copies the supplied string to the field. You may dispose of the source string after a call to this method. myFrame.GetField(ID3FN_TEXT)->Set("ID3Lib is very cool!"); | |
size_t | Get (char *, size_t) const |
Copies the contents of the field into the supplied buffer, up to the number of characters specified; for fields with multiple entries, the optional third parameter indicates which of the fields to retrieve. More... | |
size_t | Get (char *, size_t, index_t) const |
const char * | GetRawText () const |
const char * | GetRawTextItem (index_t) const |
size_t | Add (const char *data) |
dami::String | GetText () const |
dami::String | GetTextItem (index_t) const |
size_t | SetText (dami::String) |
size_t | AddText (dami::String) |
ID3_Field & | operator= (const unicode_t *s) |
Shortcut for the Set operator. Performs similarly as operator=(const char *), taking a unicode_t string as a parameter rather than an ascii string. More... | |
size_t | Set (const unicode_t *) |
Copies the supplied unicode string to the field. More... | |
size_t | Get (unicode_t *buffer, size_t) const |
Copies the contents of the field into the supplied buffer, up to the number of characters specified; for fields with multiple entries, the optional third parameter indicates which of the fields to retrieve. More... | |
size_t | Get (unicode_t *buffer, size_t, index_t) const |
size_t | Add (const unicode_t *) |
const unicode_t * | GetRawUnicodeText () const |
const unicode_t * | GetRawUnicodeTextItem (index_t) const |
size_t | Set (const uchar *buf, size_t size) |
size_t | Set (const char *buf, size_t size) |
size_t | Get (uchar *, size_t) const |
Copies the field's internal string to the buffer. More... | |
const uchar * | GetRawBinary () const |
void | FromFile (const char *) |
Copies binary data from the file specified to the field. More... | |
void | ToFile (const char *sInfo) const |
Copies binary data from the field to the specified file. More... | |
size_t | SetBinary (dami::BString) |
Copies the supplied unicode string to the field. More... | |
dami::BString | GetBinary () const |
ID3_Field & | operator= (const ID3_Field &) |
bool | InScope (ID3_V2Spec spec) const |
ID3_FieldID | GetID () const |
ID3_FieldType | GetType () const |
bool | SetEncoding (ID3_TextEnc enc) |
ID3_TextEnc | GetEncoding () const |
bool | IsEncodable () const |
void | Render (ID3_Writer &) const |
bool | Parse (ID3_Reader &) |
bool | HasChanged () const |
Protected Methods | |
void | RenderInteger (ID3_Writer &) const |
void | RenderText (ID3_Writer &) const |
void | RenderBinary (ID3_Writer &) const |
bool | ParseInteger (ID3_Reader &) |
bool | ParseText (ID3_Reader &) |
bool | ParseBinary (ID3_Reader &) |
Friends | |
class | ID3_FrameImpl |
|
|
|
Reimplemented from ID3_Field. Definition at line 69 of file field_string_unicode.cpp. References GetEncoding(), GetType(), ID3FTY_TEXTSTRING, ID3TE_UNICODE, and unicode_t. |
|
Reimplemented from ID3_Field. Definition at line 259 of file field_string_ascii.cpp. References GetType(), and ID3FTY_TEXTSTRING. |
|
Definition at line 249 of file field_string_ascii.cpp. References GetType(), and ID3FTY_TEXTSTRING. Referenced by ParseText(). |
|
Reimplemented from ID3_Field. Definition at line 997 of file field.cpp. References GetEncoding(), ID3_TextEnc, ID3FF_CSTR, ID3FTY_TEXTSTRING, ID3TE_UNICODE, and Size(). |
|
Clears any data and frees any memory associated with the field.
Reimplemented from ID3_Field. Definition at line 928 of file field.cpp. References GetEncoding(), ID3FTY_BINARY, ID3FTY_INTEGER, ID3FTY_TEXTSTRING, ID3TE_ASCII, and ID3TE_UNICODE. Referenced by ParseInteger(), ParseText(), and SetInteger(). |
|
Copies binary data from the file specified to the field.
myFrame.GetField(ID3FN_DATA)->FromFile("mypic.jpg"); Reimplemented from ID3_Field. Definition at line 141 of file field_binary.cpp. References GetType(), ID3FTY_BINARY, NULL, Set(), and uchar. |
|
Copies the field's internal string to the buffer. It copies the data in the field into the buffer, for as many bytes as the field contains, or the size of buffer, whichever is smaller.
uchar buffer[1024]; myFrame.GetField(ID3FN_DATA)->Get(buffer, sizeof(buffer)); Reimplemented from ID3_Field. Definition at line 118 of file field_binary.cpp. References GetType(), ID3FTY_BINARY, NULL, and uchar. |
|
Reimplemented from ID3_Field. Definition at line 147 of file field_string_unicode.cpp. References GetEncoding(), GetNumTextItems(), GetRawUnicodeTextItem(), GetType(), ID3FTY_TEXTSTRING, ID3TE_UNICODE, index_t, NULL, NULL_UNICODE, and unicode_t. |
|
Copies the contents of the field into the supplied buffer, up to the number of characters specified; for fields with multiple entries, the optional third parameter indicates which of the fields to retrieve. Performs similarly as the ASCII Get(char *, size_t, index_t) method, taking a unicode_t string as a parameter rather than an ascii string. The maxChars parameter still represents the maximum number of characters, not bytes.
unicode_t myBuffer[1024]; size_t charsUsed = myFrame.GetField(ID3FN_UNICODE)->Get(buffer, 1024);
Reimplemented from ID3_Field. Definition at line 101 of file field_string_unicode.cpp. References GetEncoding(), GetType(), ID3FTY_TEXTSTRING, ID3TE_UNICODE, NULL, NULL_UNICODE, Size(), and unicode_t. |
|
Reimplemented from ID3_Field. Definition at line 115 of file field_string_ascii.cpp. References GetEncoding(), GetTextItem(), GetType(), ID3FTY_TEXTSTRING, ID3TE_ASCII, index_t, and NULL. |
|
Copies the contents of the field into the supplied buffer, up to the number of characters specified; for fields with multiple entries, the optional third parameter indicates which of the fields to retrieve. The third parameter is useful when using text lists (see Add(const char*) for more details). The default value for this third parameter is 1, which returns the entire string if the field contains only one item. It returns the number of characters (not bytes necessarily, and not including any NULL terminator) of the supplied buffer that are now used.
char myBuffer[1024]; size_t charsUsed = myFrame.GetField(ID3FN_TEXT)->Get(buffer, 1024); It fills the buffer with as much data from the field as is present in the field, or as large as the buffer, whichever is smaller.
char myBuffer[1024]; size_t charsUsed = myFrame.GetField(ID3FN_TEXT)->Get(buffer, 1024, 3); This fills the buffer with up to the first 1024 characters from the third element of the text list.
Reimplemented from ID3_Field. Definition at line 96 of file field_string_ascii.cpp. References GetEncoding(), GetText(), GetType(), ID3FTY_TEXTSTRING, ID3TE_ASCII, and NULL. |
|
Returns the value of the integer field.
uint32 picType = myFrame.GetField(ID3FN_PICTURETYPE)->Get();
Reimplemented from ID3_Field. Definition at line 77 of file field_integer.cpp. References GetInteger(), and uint32. |
|
Definition at line 86 of file field_binary.cpp. References GetType(), and ID3FTY_BINARY. Referenced by operator=(). |
|
Reimplemented from ID3_Field. Definition at line 105 of file field_impl.h. References ID3_TextEnc. Referenced by Add(), BinSize(), Clear(), Get(), GetRawText(), GetRawTextItem(), GetRawUnicodeText(), GetRawUnicodeTextItem(), GetTextItem(), operator=(), ParseText(), RenderText(), Set(), and SetEncoding(). |
|
Reimplemented from ID3_Field. Definition at line 102 of file field_impl.h. References ID3_FieldID. |
|
Definition at line 82 of file field_integer.cpp. References GetType(), ID3FTY_INTEGER, and uint32. |
|
Returns the number of items in a text list.
size_t numItems = myFrame.GetField(ID3FN_UNICODE)->GetNumItems();
Reimplemented from ID3_Field. Definition at line 408 of file field_string_ascii.cpp. Referenced by Get(), GetRawTextItem(), and GetRawUnicodeTextItem(). |
|
Reimplemented from ID3_Field. Definition at line 97 of file field_binary.cpp. References GetType(), ID3FTY_BINARY, NULL, and uchar. |
|
Reimplemented from ID3_Field. Definition at line 270 of file field_string_ascii.cpp. References GetEncoding(), GetType(), ID3FTY_TEXTSTRING, ID3TE_ASCII, and NULL. |
|
Reimplemented from ID3_Field. Definition at line 281 of file field_string_ascii.cpp. References GetEncoding(), GetNumTextItems(), GetType(), ID3_TextEnc, ID3FTY_TEXTSTRING, ID3TE_ASCII, index_t, and NULL. Referenced by GetTextItem(). |
|
Reimplemented from ID3_Field. Definition at line 119 of file field_string_unicode.cpp. References GetEncoding(), GetType(), ID3FTY_TEXTSTRING, ID3TE_UNICODE, NULL, and unicode_t. |
|
Reimplemented from ID3_Field. Definition at line 130 of file field_string_unicode.cpp. References GetEncoding(), GetNumTextItems(), GetType(), ID3FTY_TEXTSTRING, ID3TE_ASCII, index_t, NULL, and unicode_t. Referenced by Get(). |
|
Definition at line 133 of file field_string_ascii.cpp. References GetType(), and ID3FTY_TEXTSTRING. |
|
Definition at line 143 of file field_string_ascii.cpp. References GetEncoding(), GetRawTextItem(), GetType(), ID3FTY_TEXTSTRING, ID3TE_ASCII, index_t, and NULL. Referenced by Get(). |
|
Reimplemented from ID3_Field. Definition at line 103 of file field_impl.h. References ID3_FieldType, and ID3_TextEnc. Referenced by Add(), AddText(), FromFile(), Get(), GetBinary(), GetInteger(), GetRawBinary(), GetRawText(), GetRawTextItem(), GetRawUnicodeText(), GetRawUnicodeTextItem(), GetText(), GetTextItem(), operator=(), Parse(), Render(), Set(), SetInteger(), SetText(), and ToFile(). |
|
Reimplemented from ID3_Field. |
|
Reimplemented from ID3_Field. Definition at line 99 of file field_impl.h. References ID3_V2Spec. |
|
Reimplemented from ID3_Field. Definition at line 106 of file field_impl.h. References flags_t, ID3_FieldID, ID3_FieldType, ID3_FrameID, ID3_TextEnc, ID3_V2Spec, ID3FF_ENCODABLE, and uint32. Referenced by SetEncoding(). |
|
Reimplemented from ID3_Field. Definition at line 1147 of file field.cpp. References GetBinary(), GetEncoding(), GetInteger(), GetText(), GetType(), ID3FTY_BINARY, ID3FTY_INTEGER, ID3FTY_TEXTSTRING, SetBinary(), SetEncoding(), SetInteger(), and SetText(). |
|
Shortcut for the Set operator. Performs similarly as operator=(const char *), taking a unicode_t string as a parameter rather than an ascii string.
Reimplemented from ID3_Field. Definition at line 75 of file field_impl.h. |
|
Shortcut for the Set operator.
Reimplemented from ID3_Field. Definition at line 61 of file field_impl.h. |
|
A shortcut for the Set method.
myFrame.GetField(ID3FN_PICTURETYPE)->= 0x0B;
Reimplemented from ID3_Field. Definition at line 53 of file field_impl.h. |
|
Reimplemented from ID3_Field. Definition at line 1048 of file field.cpp. References GetType(), ID3FTY_BINARY, ID3FTY_INTEGER, ID3FTY_TEXTSTRING, ParseBinary(), ParseInteger(), and ParseText(). |
|
Definition at line 200 of file field_binary.cpp. Referenced by Parse(). |
|
Definition at line 92 of file field_integer.cpp. References ID3_Reader::atEnd(), Clear(), ID3_Reader::getBeg(), ID3_Reader::getCur(), ID3_Reader::getEnd(), Set(), and Size(). Referenced by Parse(). |
|
Definition at line 336 of file field_string_ascii.cpp. References AddText(), ID3_Reader::atEnd(), Clear(), ID3_Reader::getBeg(), ID3_Reader::getCur(), GetEncoding(), ID3_Reader::getEnd(), ID3_TextEnc, ID3FF_CSTR, ID3FF_LIST, ID3_Reader::remainingBytes(), SetText(), and Size(). Referenced by Parse(). |
|
Reimplemented from ID3_Field. Definition at line 1116 of file field.cpp. References GetType(), ID3FTY_BINARY, ID3FTY_INTEGER, ID3FTY_TEXTSTRING, RenderBinary(), RenderInteger(), and RenderText(). |
|
Definition at line 208 of file field_binary.cpp. References Size(), and ID3_Writer::writeChars(). Referenced by Render(). |
|
Definition at line 110 of file field_integer.cpp. Referenced by Render(). |
|
Definition at line 385 of file field_string_ascii.cpp. References GetEncoding(), ID3_TextEnc, and ID3FF_CSTR. Referenced by Render(). |
|
Definition at line 85 of file field_impl.h. |
|
Reimplemented from ID3_Field. Definition at line 44 of file field_binary.cpp. References GetType(), ID3FTY_BINARY, and uchar. |
|
Copies the supplied unicode string to the field. Performs similarly as the ASCII Set() method, taking a unicode_t string as a parameter rather than an ascii string.
Reimplemented from ID3_Field. Definition at line 57 of file field_string_unicode.cpp. References GetEncoding(), GetType(), ID3FTY_TEXTSTRING, ID3TE_UNICODE, and unicode_t. |
|
Copies the supplied string to the field. You may dispose of the source string after a call to this method. myFrame.GetField(ID3FN_TEXT)->Set("ID3Lib is very cool!");
Reimplemented from ID3_Field. Definition at line 54 of file field_string_ascii.cpp. References GetType(), and ID3FTY_TEXTSTRING. |
|
Sets the value of the field to the specified integer.
Reimplemented from ID3_Field. Definition at line 52 of file field_integer.cpp. References SetInteger(), and uint32. Referenced by FromFile(), operator=(), ParseInteger(), and Set(). |
|
Copies the supplied unicode string to the field. Again, like the string types, the binary Set() function copies the data so you may dispose of the source data after a call to this method. Definition at line 60 of file field_binary.cpp. References ID3FTY_BINARY. Referenced by operator=(). |
|
Reimplemented from ID3_Field. Definition at line 1179 of file field.cpp. References GetEncoding(), ID3_TextEnc, ID3TE_NONE, ID3TE_NUMENCODINGS, and IsEncodable(). Referenced by operator=(). |
|
Definition at line 57 of file field_integer.cpp. References Clear(), GetType(), ID3FTY_INTEGER, and uint32. |
|
Definition at line 198 of file field_string_ascii.cpp. References GetType(), ID3FTY_TEXTSTRING, and ID3TE_UNICODE. |
|
Returns the size of a field. The value returned is dependent on the type of the field. For ASCII strings, this returns the number of characters in the field, not including any NULL-terminator. The same holds true for Unicode---it returns the number of characters in the field, not bytes, and this does not include the Unicode BOM, which isn't put in a Unicode string obtained by the Get(unicode_t*, size_t, index_t) method anyway. For binary and integer fields, this returns the number of bytes in the field.
size_t howBig = myFrame.GetField(ID3FN_DATA)->Size();
Reimplemented from ID3_Field. Definition at line 1023 of file field.cpp. References ID3FTY_INTEGER, and ID3FTY_TEXTSTRING. Referenced by BinSize(), Get(), ParseInteger(), ParseText(), RenderBinary(), and ToFile(). |
|
Copies binary data from the field to the specified file.
myFrame.GetField(ID3FN_DATA)->ToFile("output.bin"); Reimplemented from ID3_Field. Definition at line 177 of file field_binary.cpp. References GetType(), ID3FTY_BINARY, NULL, and Size(). |
|
Definition at line 42 of file field_impl.h. |