FLAC
1.4.3
Free Lossless Audio Codec
|
#include <metadata.h>
Public Member Functions | |
Entry (const char *field, uint32_t field_length) | |
Entry (const char *field) | |
Entry (const char *field_name, const char *field_value, uint32_t field_value_length) | |
Entry (const char *field_name, const char *field_value) | |
Entry (const Entry &entry) | |
Entry & | operator= (const Entry &entry) |
virtual bool | is_valid () const |
uint32_t | get_field_length () const |
uint32_t | get_field_name_length () const |
uint32_t | get_field_value_length () const |
::FLAC__StreamMetadata_VorbisComment_Entry | get_entry () const |
const char * | get_field () const |
const char * | get_field_name () const |
const char * | get_field_value () const |
bool | set_field (const char *field, uint32_t field_length) |
bool | set_field (const char *field) |
bool | set_field_name (const char *field_name) |
bool | set_field_value (const char *field_value, uint32_t field_value_length) |
bool | set_field_value (const char *field_value) |
Protected Attributes | |
bool | is_valid_ |
::FLAC__StreamMetadata_VorbisComment_Entry | entry_ |
char * | field_name_ |
uint32_t | field_name_length_ |
char * | field_value_ |
uint32_t | field_value_length_ |
Convenience class for encapsulating Vorbis comment entries. An entry is a vendor string or a comment field. In the case of a vendor string, the field name is undefined; only the field value is relevant.
A field as used in the methods refers to an entire 'NAME=VALUE' string; for convenience the string is NUL-terminated. A length field is required in the unlikely event that the value contains contain embedded NULs.
A field_name is what is on the left side of the first '=' in the field. By definition it is ASCII and so is NUL-terminated and does not require a length to describe it. field_name is undefined for a vendor string entry.
A field_value is what is on the right side of the first '=' in the field. By definition, this may contain embedded NULs and so a field_value_length is required to describe it. However in practice, embedded NULs are not known to be used, so it is generally safe to treat field values as NUL- terminated UTF-8 strings.
Always check is_valid() after the constructor or operator= to make sure memory was properly allocated and that the Entry conforms to the Vorbis comment specification.