Classes | Public Member Functions | Private Member Functions | Static Private Member Functions | List of all members
rapidxml::xml_document< Ch > Class Template Reference

#include <rapidxml.hpp>

Inheritance diagram for rapidxml::xml_document< Ch >:
Inheritance graph
[legend]

Classes

struct  attribute_name_pred
 
struct  attribute_value_pred
 
struct  attribute_value_pure_pred
 
struct  node_name_pred
 
struct  text_pred
 
struct  text_pure_no_ws_pred
 
struct  text_pure_with_ws_pred
 
struct  whitespace_pred
 

Public Member Functions

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

Private Member Functions

template<int Flags>
Ch parse_and_append_data (xml_node< Ch > *node, Ch *&text, Ch *contents_start)
 
template<int Flags>
void parse_bom (Ch *&text)
 
template<int Flags>
xml_node< Ch > * parse_cdata (Ch *&text)
 
template<int Flags>
xml_node< Ch > * parse_comment (Ch *&text)
 
template<int Flags>
xml_node< Ch > * parse_doctype (Ch *&text)
 
template<int Flags>
xml_node< Ch > * parse_element (Ch *&text)
 
template<int Flags>
xml_node< Ch > * parse_node (Ch *&text)
 
template<int Flags>
void parse_node_attributes (Ch *&text, xml_node< Ch > *node)
 
template<int Flags>
void parse_node_contents (Ch *&text, xml_node< Ch > *node)
 
template<int Flags>
xml_node< Ch > * parse_pi (Ch *&text)
 
template<int Flags>
xml_node< Ch > * parse_xml_declaration (Ch *&text)
 

Static Private Member Functions

template<int Flags>
static void insert_coded_character (Ch *&text, unsigned long code)
 
template<class StopPred , int Flags>
static void skip (Ch *&text)
 
template<class StopPred , class StopPredPure , int Flags>
static Ch * skip_and_expand_character_refs (Ch *&text)
 

Additional Inherited Members

- Static Protected Member Functions inherited from rapidxml::xml_base< Ch >
static Ch * nullstr ()
 
- Protected Attributes inherited from rapidxml::xml_base< Ch >
Ch * m_name
 
std::size_t m_name_size
 
xml_node< Ch > * m_parent
 
Ch * m_value
 
std::size_t m_value_size
 

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.

Definition at line 139 of file rapidxml.hpp.

Constructor & Destructor Documentation

template<class Ch = char>
rapidxml::xml_document< Ch >::xml_document ( )
inline

Constructs empty XML document.

Definition at line 1364 of file rapidxml.hpp.

Member Function Documentation

template<class Ch = char>
void rapidxml::xml_document< Ch >::clear ( void  )
inline

Clears the document by deleting all nodes and clearing the memory pool. All nodes owned by document pool are destroyed.

Definition at line 1415 of file rapidxml.hpp.

template<class Ch = char>
template<int Flags>
static void rapidxml::xml_document< Ch >::insert_coded_character ( Ch *&  text,
unsigned long  code 
)
inlinestaticprivate

Definition at line 1511 of file rapidxml.hpp.

template<class Ch = char>
template<int Flags>
void rapidxml::xml_document< Ch >::parse ( Ch *  text)
inline

Parses zero-terminated XML string according to given flags. Passed string will be modified by the parser, unless rapidxml::parse_non_destructive flag is used. The string must persist for the lifetime of the document. In case of error, rapidxml::parse_error exception will be thrown.

If you want to parse contents of a file, you must first load the file into the memory, and pass pointer to its beginning. Make sure that data is zero-terminated.

Document can be parsed into multiple times. Each new call to parse removes previous nodes and attributes (if any), but does not clear memory pool.

Parameters
textXML data to parse; pointer is non-const to denote fact that this data may be modified by the parser.

Definition at line 1381 of file rapidxml.hpp.

template<class Ch = char>
template<int Flags>
Ch rapidxml::xml_document< Ch >::parse_and_append_data ( xml_node< Ch > *  node,
Ch *&  text,
Ch *  contents_start 
)
inlineprivate

Definition at line 1940 of file rapidxml.hpp.

template<class Ch = char>
template<int Flags>
void rapidxml::xml_document< Ch >::parse_bom ( Ch *&  text)
inlineprivate

Definition at line 1725 of file rapidxml.hpp.

template<class Ch = char>
template<int Flags>
xml_node<Ch>* rapidxml::xml_document< Ch >::parse_cdata ( Ch *&  text)
inlineprivate

Definition at line 1998 of file rapidxml.hpp.

template<class Ch = char>
template<int Flags>
xml_node<Ch>* rapidxml::xml_document< Ch >::parse_comment ( Ch *&  text)
inlineprivate

Definition at line 1773 of file rapidxml.hpp.

template<class Ch = char>
template<int Flags>
xml_node<Ch>* rapidxml::xml_document< Ch >::parse_doctype ( Ch *&  text)
inlineprivate

Definition at line 1814 of file rapidxml.hpp.

template<class Ch = char>
template<int Flags>
xml_node<Ch>* rapidxml::xml_document< Ch >::parse_element ( Ch *&  text)
inlineprivate

Definition at line 2037 of file rapidxml.hpp.

template<class Ch = char>
template<int Flags>
xml_node<Ch>* rapidxml::xml_document< Ch >::parse_node ( Ch *&  text)
inlineprivate

Definition at line 2081 of file rapidxml.hpp.

template<class Ch = char>
template<int Flags>
void rapidxml::xml_document< Ch >::parse_node_attributes ( Ch *&  text,
xml_node< Ch > *  node 
)
inlineprivate

Definition at line 2237 of file rapidxml.hpp.

template<class Ch = char>
template<int Flags>
void rapidxml::xml_document< Ch >::parse_node_contents ( Ch *&  text,
xml_node< Ch > *  node 
)
inlineprivate

Definition at line 2167 of file rapidxml.hpp.

template<class Ch = char>
template<int Flags>
xml_node<Ch>* rapidxml::xml_document< Ch >::parse_pi ( Ch *&  text)
inlineprivate

Definition at line 1880 of file rapidxml.hpp.

template<class Ch = char>
template<int Flags>
xml_node<Ch>* rapidxml::xml_document< Ch >::parse_xml_declaration ( Ch *&  text)
inlineprivate

Definition at line 1738 of file rapidxml.hpp.

template<class Ch = char>
template<class StopPred , int Flags>
static void rapidxml::xml_document< Ch >::skip ( Ch *&  text)
inlinestaticprivate

Definition at line 1558 of file rapidxml.hpp.

template<class Ch = char>
template<class StopPred , class StopPredPure , int Flags>
static Ch* rapidxml::xml_document< Ch >::skip_and_expand_character_refs ( Ch *&  text)
inlinestaticprivate

Definition at line 1570 of file rapidxml.hpp.


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


mvsim
Author(s):
autogenerated on Fri May 7 2021 03:05:52