libgta
1.0.4
Read and Write Generic Tagged Array (GTA) files
|
Tag Lists. More...
Public Member Functions | |
uintmax_t | tags () const |
Get the number of tags. | |
const char * | name (uintmax_t i) const |
Get a tag name. | |
const char * | value (uintmax_t i) const |
Get a tag value. | |
const char * | get (const char *name) const |
Get a tag value by its name. | |
void | set (const char *name, const char *value) |
Set a tag. | |
void | unset (const char *name) |
Unset a tag. | |
void | unset_all () |
Unset all tags. | |
const taglist & | operator= (const taglist &tl) |
Assignment operator. | |
Friends | |
class | header |
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.
uintmax_t gta::taglist::tags | ( | ) | const [inline] |
Get the number of tags.
const char* gta::taglist::name | ( | uintmax_t | i | ) | const [inline] |
Get a tag name.
i | The tag index. |
const char* gta::taglist::value | ( | uintmax_t | i | ) | const [inline] |
Get a tag value.
i | The tag index. |
const char* gta::taglist::get | ( | const char * | name | ) | const [inline] |
Get a tag value by its name.
name | The tag name. |
void gta::taglist::set | ( | const char * | name, |
const char * | value | ||
) | [inline] |
Set a tag.
name | The tag name. |
value | The 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.
name | The tag name. |
Removes the tag with the given name, if it exists.
void gta::taglist::unset_all | ( | ) | [inline] |
Unset all tags.
Removes all tags.
Assignment operator.
tl | The tag list to copy. |