libgta  1.0.8
Read and Write Generic Tagged Array (GTA) files
Public Member Functions | Friends | List of all members
gta::taglist Class Reference

Tag Lists. More...

Public Member Functions

uintmax_t tags () const
 Get the number of tags. More...
 
const char * name (uintmax_t i) const
 Get a tag name. More...
 
const char * value (uintmax_t i) const
 Get a tag value. More...
 
const char * get (const char *name) const
 Get a tag value by its name. More...
 
void set (const char *name, const char *value)
 Set a tag. More...
 
void unset (const char *name)
 Unset a tag. More...
 
void unset_all ()
 Unset all tags. More...
 
const taglistoperator= (const taglist &tl)
 Assignment operator. More...
 

Friends

class header
 

Detailed Description

Tag Lists.

GTA stores meta information in tags. Tag names are non-empty UTF-8 strings that must not contain '='.
Tag values are UTF-8 strings.
If you do not want to deal with conversions between the local character set and UTF-8, you must restrict names and values to ASCII.

Member Function Documentation

uintmax_t gta::taglist::tags ( ) const
inline

Get the number of tags.

Returns
The number of tags.
const char* gta::taglist::name ( uintmax_t  i) const
inline

Get a tag name.

Parameters
iThe tag index.
Returns
The name of the tag.
const char* gta::taglist::value ( uintmax_t  i) const
inline

Get a tag value.

Parameters
iThe tag index.
Returns
The value of the tag.
const char* gta::taglist::get ( const char *  name) const
inline

Get a tag value by its name.

Parameters
nameThe tag name.
Returns
The tag value, or NULL if the tag name is not found.
void gta::taglist::set ( const char *  name,
const char *  value 
)
inline

Set a tag.

Parameters
nameThe tag name.
valueThe tag value.

Sets the given tag, possibly overwriting an existing tag with the same name. The name and value must be valid UTF-8 strings without control characters. Additionally, the name must not contain the equal sign and must not be empty.

void gta::taglist::unset ( const char *  name)
inline

Unset a tag.

Parameters
nameThe tag name.

Removes the tag with the given name, if it exists.

void gta::taglist::unset_all ( )
inline

Unset all tags.

Removes all tags.

const taglist& gta::taglist::operator= ( const taglist tl)
inline

Assignment operator.

Parameters
tlThe tag list to copy.

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