Pin
Public Member Functions | Protected Member Functions | List of all members
LEVEL_BASE::SimpleXMLParser Class Referenceabstract

Public Member Functions

 SimpleXMLParser (std::istream *input)
 
bool parse ()
 
std::string getErrorString ()
 

Protected Member Functions

virtual void visitNode ()=0
 
size_t getElementsStackCount ()
 
const std::string & getElementName (size_t n)
 
std::string getInnermostElementText ()
 

Detailed Description

class that provides XML parsing capabilities

Constructor & Destructor Documentation

◆ SimpleXMLParser()

LEVEL_BASE::SimpleXMLParser::SimpleXMLParser ( std::istream *  input)
inline

Creates a new XML parser instance.

Parameters
[in]input- Pointer to an instance of istream from while the XML can be read.

Member Function Documentation

◆ getElementName()

const std::string& LEVEL_BASE::SimpleXMLParser::getElementName ( size_t  n)
inlineprotected

Gets the name of one of the nested nodes we're currently visiting (valid only inside visitNode()).

Parameters
[in]n- The nesting level of the node that we want to get its name. while 0 being the outermode node.
Returns
The name of the n-th node.

◆ getElementsStackCount()

size_t LEVEL_BASE::SimpleXMLParser::getElementsStackCount ( )
inlineprotected
Returns
The number of nested nodes we're currently visiting (valid only inside visitNode()).

◆ getErrorString()

std::string LEVEL_BASE::SimpleXMLParser::getErrorString ( )
inline

Get a string denoting the last error reason. Valid only after calling parse().

Returns
String with error message.

◆ getInnermostElementText()

std::string LEVEL_BASE::SimpleXMLParser::getInnermostElementText ( )
inlineprotected
Returns
The text in the innermost node that is being parsed (valid only inside visitNode()).

◆ parse()

bool LEVEL_BASE::SimpleXMLParser::parse ( )

Parse the XML by reading characters from the input stream.

Returns
TRUE upon success, FALSE upon failure.

◆ visitNode()

virtual void LEVEL_BASE::SimpleXMLParser::visitNode ( )
protectedpure virtual

This function should be overriden by subclasses of this class. It is called after parsing on each XML node (particularily when the parser encounters the node closes token).


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