FLAC  1.3.1
Public Member Functions | Protected Attributes | List of all members

#include <metadata.h>

Public Member Functions

 Entry (const char *field, unsigned field_length)
 
 Entry (const char *field)
 
 Entry (const char *field_name, const char *field_value, unsigned field_value_length)
 
 Entry (const char *field_name, const char *field_value)
 
 Entry (const Entry &entry)
 
Entryoperator= (const Entry &entry)
 
virtual bool is_valid () const
 
unsigned get_field_length () const
 
unsigned get_field_name_length () const
 
unsigned 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, unsigned field_length)
 
bool set_field (const char *field)
 
bool set_field_name (const char *field_name)
 
bool set_field_value (const char *field_value, unsigned field_value_length)
 
bool set_field_value (const char *field_value)
 

Protected Attributes

bool is_valid_
 
::FLAC__StreamMetadata_VorbisComment_Entry entry_
 
char * field_name_
 
unsigned field_name_length_
 
char * field_value_
 
unsigned field_value_length_
 

Detailed Description

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.

Member Function Documentation

virtual bool FLAC::Metadata::VorbisComment::Entry::is_valid ( ) const
virtual

Returns true iff object was properly constructed.


The documentation for this class was generated from the following file: