cphot 0.1
A C++ tool for computing photometry from spectra.
rapidxml::xml_document< Ch > Class Template Reference

This class represents root of the DOM hierarchy. More...

#include <rapidxml.hpp>

Public Member Functions

 xml_document ()
 Constructs empty XML document. More...
 
template<int Flags>
Ch * parse (Ch *text, xml_document< Ch > *parent=0)
 Parses zero-terminated XML string according to given flags. More...
 
template<int Flags>
Ch * parse (Ch *text, xml_document< Ch > &parent)
 
void clear ()
 Clears the document by deleting all nodes and clearing the memory pool. More...
 
template<int Flags>
void fixup (xml_node< Ch > *element, bool recurse)
 Terminates and/or decodes existing parsed tree, optionally recursively. More...
 
void validate () const
 

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 142 of file rapidxml.hpp.

Constructor & Destructor Documentation

◆ xml_document()

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

Constructs empty XML document.

Definition at line 1578 of file rapidxml.hpp.

Member Function Documentation

◆ clear()

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

Clears the document by deleting all nodes and clearing the memory pool.

All nodes owned by document pool are destroyed.

Definition at line 1640 of file rapidxml.hpp.

◆ fixup()

template<class Ch = char>
template<int Flags>
void rapidxml::xml_document< Ch >::fixup ( xml_node< Ch > *  element,
bool  recurse 
)
inline

Terminates and/or decodes existing parsed tree, optionally recursively.

Definition at line 1650 of file rapidxml.hpp.

◆ parse() [1/2]

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

Definition at line 1633 of file rapidxml.hpp.

◆ parse() [2/2]

template<class Ch = char>
template<int Flags>
Ch* rapidxml::xml_document< Ch >::parse ( Ch *  text,
xml_document< Ch > *  parent = 0 
)
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 1595 of file rapidxml.hpp.

◆ validate()

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

Definition at line 1688 of file rapidxml.hpp.


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