|
| TagDoc () |
| Constructor for a new empty tag document.
|
|
| ~TagDoc () |
| Destructor.
|
|
int | tag_id (const std::string &name) |
| Returns the tag id for a name or allocates a new one if the name has not already been used. More...
|
|
const std::string & | tag_name (int id) const |
| Get the name of the tag given its id. More...
|
|
int | tag_id_if_exists (const std::string &name) const |
| Gets a tag id if it has already been defined. More...
|
|
int | attribute_id (const std::string &name) |
| Returns the attribute id for a name or allocates a new one if the name has not already been used. More...
|
|
int | attribute_id_if_exists (const std::string &name) const |
| Gets a attribute id if it has already been defined. More...
|
|
const std::string & | attribute_name (int id) const |
| Get the name of the attribute given its id. More...
|
|
void | write_tag (std::ostream &os, Tag *tag, int indent=0) |
| Write a tag and all its children to an output stream. More...
|
|
void | read_tag (std::istream &is) |
| Reads a tag and all its children from a stream. More...
|
|
int | id () const |
| Return the tag id. More...
|
|
const std::string & | name () const |
| Return the name of this type of tag.
|
|
TagDoc * | doc () const |
| Return the document this tag belongs to.
|
|
Tag * | parent () const |
| Get the parent for this tag. More...
|
|
Tag * | first_child () const |
| Get the first child tag. More...
|
|
Tag * | last_child () const |
| Get the last child tag. More...
|
|
Tag * | next () const |
| Get the next sibling tag. More...
|
|
TagAttribute * | first_attribute () const |
| Get the first attribute of this tag. More...
|
|
Tag * | add_child (int id) |
| Add a new tag as a child of this tag. More...
|
|
Tag * | add_child (const std::string &name) |
| Add a new tag with the given name as a child of this tag. More...
|
|
void | delete_child (Tag *tag) |
| Deletes at child tag. More...
|
|
Tag * | find_child (int id, Tag *after=NULL) const |
| Find the a child tag with the given id. More...
|
|
Tag * | find_child (const std::string &name, Tag *after=NULL) const |
| Find the a child tag with the given name. More...
|
|
Tag * | find_child (int id, int attId, Tag *after=NULL) const |
| Find a child tag with the given attribute. More...
|
|
Tag * | find_child (const std::string &name, const std::string &attName, Tag *after=NULL) const |
| Find a child tag with the given attribute. More...
|
|
Tag * | find_child (int id, int attId, const std::string &value, Tag *after=NULL) const |
| Find a child tag with the given attribute value. More...
|
|
Tag * | find_child (const std::string &name, const std::string &attName, const std::string &value, Tag *after=NULL) const |
| Find a child tag with the given attribute value. More...
|
|
const std::string & | text () const |
| Get the text from the tag. More...
|
|
void | text (const std::string &text) |
| Set the text for this tag. More...
|
|
TagData * | data () const |
| Get the user data for this tag. More...
|
|
void | data (TagData *data) |
| Set the data for this tag. More...
|
|
void | attribute (int att_id) |
| Sets attribute with given id on the tag with no value. More...
|
|
void | attribute (int att_id, const std::string &value) |
| Sets attribute with given id on the tag with the given value. More...
|
|
void | delete_attribute (int attId) |
| Delete the attribute with the given id. More...
|
|
void | attribute (const std::string &name) |
| Sets attribute with given name on the tag with no value. More...
|
|
void | attribute (const std::string &name, const std::string &value) |
| Sets attribute with given name on the tag with the given value. More...
|
|
void | delete_attribute (const std::string &name) |
| Delete the named attribute. More...
|
|
TagAttribute * | find_attribute (int att_id) const |
| Find the attribute with the given id. More...
|
|
TagAttribute * | find_attribute (const std::string &name) const |
| Find the attribute with the given id. More...
|
|
std::string | attribute_value (int att_id) const |
| Get the value of an attribute. More...
|
|
std::string | attribute_value (const std::string &name) const |
| Get the value of an attribute. More...
|
|
Document that stores Tags with optional attributes in a hierarchy.
The document is the root of the tree and allocates the ids used for the tag and attribute names.
It also allows loading and saving of the tags using a simple XML like text file format.