|
| void | clear () |
| | Clears the document by deleting all nodes and clearing the memory pool.
|
| |
| template<int Flags> |
| void | parse (Ch *text) |
| | Parses zero-terminated XML string according to given flags.
|
| |
| | xml_document () |
| | Constructs empty XML document.
|
| |
| void | append_attribute (xml_attribute< char > *attribute) |
| | Appends a new attribute to the node.
|
| |
| void | append_node (xml_node< char > *child) |
| | Appends a new child node.
|
| |
| xml_document< char > * | document () const |
| | Gets document of which node is a child.
|
| |
| xml_attribute< char > * | first_attribute (const char *name=nullptr, std::size_t name_size=0, bool case_sensitive=true) const |
| | Gets first attribute of node, optionally matching attribute name.
|
| |
| xml_node< char > * | first_node (const char *name=nullptr, std::size_t name_size=0, bool case_sensitive=true) const |
| | Gets first child node, optionally matching node name.
|
| |
| void | insert_attribute (xml_attribute< char > *where, xml_attribute< char > *attribute) |
| | Inserts a new attribute at specified place inside the node.
|
| |
| void | insert_node (xml_node< char > *where, xml_node< char > *child) |
| | Inserts a new child node at specified place inside the node.
|
| |
| xml_attribute< char > * | last_attribute (const char *name=0, std::size_t name_size=0, bool case_sensitive=true) const |
| | Gets last attribute of node, optionally matching attribute name.
|
| |
| xml_node< char > * | last_node (const char *name=0, std::size_t name_size=0, bool case_sensitive=true) const |
| | Gets last child node, optionally matching node name.
|
| |
| xml_node< char > * | next_sibling (const char *name=nullptr, std::size_t name_size=0, bool case_sensitive=true) const |
| | Gets next sibling node, optionally matching node name.
|
| |
| void | prepend_attribute (xml_attribute< char > *attribute) |
| | Prepends a new attribute to the node.
|
| |
| void | prepend_node (xml_node< char > *child) |
| | Prepends a new child node.
|
| |
| xml_node< char > * | previous_sibling (const char *name=0, std::size_t name_size=0, bool case_sensitive=true) const |
| | Gets previous sibling node, optionally matching node name.
|
| |
| void | remove_all_attributes () |
| | Removes all attributes of node.
|
| |
| void | remove_all_nodes () |
| | Removes all child nodes (but not attributes).
|
| |
| void | remove_attribute (xml_attribute< char > *where) |
| | Removes specified attribute from node.
|
| |
| void | remove_first_attribute () |
| | Removes first attribute of the node.
|
| |
| void | remove_first_node () |
| | Removes first child node.
|
| |
| void | remove_last_attribute () |
| | Removes last attribute of the node.
|
| |
| void | remove_last_node () |
| | Removes last child of the node.
|
| |
| void | remove_node (xml_node< char > *where) |
| | Removes specified child from the node.
|
| |
| node_type | type () const |
| | Gets type of node.
|
| |
| void | type (node_type type) |
| | Sets type of node.
|
| |
| | xml_node (node_type type) |
| | Constructs an empty node with the specified type.
|
| |
| char * | name () const |
| | Gets name of the node.
|
| |
| void | name (const char *name) |
| | Sets name of node to a zero-terminated string.
|
| |
| void | name (const char *name, std::size_t size) |
| | Sets name of node to a non zero-terminated string.
|
| |
| std::size_t | name_size () const |
| | Gets size of node name, not including terminator character.
|
| |
| xml_node< char > * | parent () const |
| | Gets node parent.
|
| |
| char * | value () const |
| | Gets value of node.
|
| |
| void | value (const char *value) |
| | Sets value of node to a zero-terminated string.
|
| |
| void | value (const char *value, std::size_t size) |
| | Sets value of node to a non zero-terminated string.
|
| |
| std::size_t | value_size () const |
| | Gets size of node value, not including terminator character.
|
| |
| | xml_base () |
| |
| xml_attribute< char > * | allocate_attribute (const char *name=nullptr, const char *value=nullptr, std::size_t name_size=0, std::size_t value_size=0) |
| | Allocates a new attribute from the pool, and optionally assigns name and value to it.
|
| |
| xml_node< char > * | allocate_node (node_type type, const char *name=nullptr, const char *value=nullptr, std::size_t name_size=0, std::size_t value_size=0) |
| | Allocates a new node from the pool, and optionally assigns name and value to it.
|
| |
| char * | allocate_string (const char *source=0, std::size_t size=0) |
| | Allocates a char array of given size from the pool, and optionally copies a given string to it.
|
| |
| void | clear () |
| | Clears the pool.
|
| |
| xml_node< char > * | clone_node (const xml_node< char > *source, xml_node< char > *result=0) |
| | Clones an xml_node and its hierarchy of child nodes and attributes.
|
| |
| | memory_pool () |
| | Constructs empty pool with default allocator functions.
|
| |
| void | set_allocator (alloc_func *af, free_func *ff) |
| | Sets or resets the user-defined memory allocation functions for the pool.
|
| |
| | ~memory_pool () |
| | Destroys pool and frees all the memory.
|
| |
template<class Ch = char>
class rapidxml::xml_document< Ch >
This class represents root of the DOM hierarchy.
It is also an xml_node and a memory_pool through public inheritance. Use parse() function to build a DOM tree from a zero-terminated XML text string. parse() function allocates memory for nodes and attributes by using functions of xml_document, which are inherited from memory_pool. To access root node of the document, use the document itself, as if it was an xml_node.
- Parameters
-