rapidxml
xml_document< Ch > Class Template Reference

#include <rapidxml.hpp>

Inherits xml_node< char >, and memory_pool< char >.

Public Member Functions

 xml_document ()
 Constructs empty XML document.
 
template<int Flags>
void parse (Ch *text)
 
void clear ()
 
- Public Member Functions inherited from xml_node< char >
 xml_node (node_type type)
 
node_type type () const
 
void type (node_type type)
 
xml_document< char > * document () const
 
xml_node< char > * first_node (const char *name=0, std::size_t name_size=0, bool case_sensitive=true) const
 
xml_node< char > * last_node (const char *name=0, std::size_t name_size=0, bool case_sensitive=true) const
 
xml_node< char > * previous_sibling (const char *name=0, std::size_t name_size=0, bool case_sensitive=true) const
 
xml_node< char > * next_sibling (const char *name=0, std::size_t name_size=0, bool case_sensitive=true) const
 
xml_attribute< char > * first_attribute (const char *name=0, std::size_t name_size=0, bool case_sensitive=true) const
 
xml_attribute< char > * last_attribute (const char *name=0, std::size_t name_size=0, bool case_sensitive=true) const
 
void prepend_node (xml_node< char > *child)
 
void append_node (xml_node< char > *child)
 
void insert_node (xml_node< char > *where, xml_node< char > *child)
 
void remove_first_node ()
 
void remove_last_node ()
 
void remove_node (xml_node< char > *where)
 Removes specified child from the node.
 
void remove_all_nodes ()
 Removes all child nodes (but not attributes).
 
void prepend_attribute (xml_attribute< char > *attribute)
 
void append_attribute (xml_attribute< char > *attribute)
 
void insert_attribute (xml_attribute< char > *where, xml_attribute< char > *attribute)
 
void remove_first_attribute ()
 
void remove_last_attribute ()
 
void remove_attribute (xml_attribute< char > *where)
 
void remove_all_attributes ()
 Removes all attributes of node.
 
- Public Member Functions inherited from xml_base< char >
char * name () const
 
void name (const char *name, std::size_t size)
 
void name (const char *name)
 
std::size_t name_size () const
 
char * value () const
 
void value (const char *value, std::size_t size)
 
void value (const char *value)
 
std::size_t value_size () const
 
xml_node< char > * parent () const
 
- Public Member Functions inherited from memory_pool< char >
 memory_pool ()
 Constructs empty pool with default allocator functions.
 
 ~memory_pool ()
 
xml_node< char > * allocate_node (node_type type, const char *name=0, const char *value=0, std::size_t name_size=0, std::size_t value_size=0)
 
xml_attribute< char > * allocate_attribute (const char *name=0, const char *value=0, std::size_t name_size=0, std::size_t value_size=0)
 
char * allocate_string (const char *source=0, std::size_t size=0)
 
xml_node< char > * clone_node (const xml_node< char > *source, xml_node< char > *result=0)
 
void clear ()
 
void set_allocator (alloc_func *af, free_func *ff)
 

Detailed Description

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
ChCharacter type to use.