Teuchos Package Browser (Single Doxygen Collection) Version of the Day
Public Member Functions | Private Member Functions | Static Private Member Functions | Private Attributes
Teuchos::XMLParser Class Reference

XMLParser consumes characters from an XMLInputStream object, parsing the XML and using a TreeBuildingXMLHandler to construct an XMLObject. More...

#include <Teuchos_XMLParser.hpp>

List of all members.

Public Member Functions

 XMLParser (RCP< XMLInputStream > is)
 Constructor.
 ~XMLParser ()
 Destructor.
XMLObject parse ()
 Consume the XMLInputStream to build an XMLObject.

Private Member Functions

void getETag (std::string &tag)
 Consume a ETag production according to the XML specification. getETag throws an std::exception if the input does not match the production rule.
void getSTag (unsigned char lookahead, std::string &tag, Teuchos::map< std::string, string > &attrs, bool &emptytag)
 Consume a STag production according to the XML specification. getSTag throws an std::exception if the input does not match the production rule.
void getComment ()
 Consume a Comment production according to the XML specification. getComment throws an std::exception if the input does not match the production rule.
int getSpace (unsigned char &lookahead)
 Consumes a Space (block of whitepace) production according to the XML specification.
void getReference (std::string &refstr)
 Consumes a Reference production according to the XML specification.
int assertChar (unsigned char cexp)
 Determines if the next character on the stream.

Static Private Member Functions

static bool isLetter (unsigned char c)
 Determine whether c matches the Letter production according to the XML specification.
static bool isNameChar (unsigned char c)
 Determine whether c matches the NameChar production according to the XML specification.
static bool isChar (unsigned char c)
 Determine whether c matches the Char production according to the XML specification.
static bool isSpace (unsigned char c)
 Determine whether c matches the Space production according to the XML specification.

Private Attributes

RCP< XMLInputStream_is
Teuchos::map< std::string, string > _entities

Detailed Description

XMLParser consumes characters from an XMLInputStream object, parsing the XML and using a TreeBuildingXMLHandler to construct an XMLObject.

Definition at line 61 of file Teuchos_XMLParser.hpp.


Constructor & Destructor Documentation

Teuchos::XMLParser::XMLParser ( RCP< XMLInputStream is) [inline]

Constructor.

Definition at line 66 of file Teuchos_XMLParser.hpp.

Teuchos::XMLParser::~XMLParser ( ) [inline]

Destructor.

Definition at line 69 of file Teuchos_XMLParser.hpp.


Member Function Documentation

XMLObject XMLParser::parse ( )

Consume the XMLInputStream to build an XMLObject.

Definition at line 125 of file Teuchos_XMLParser.cpp.

bool XMLParser::isLetter ( unsigned char  c) [inline, static, private]

Determine whether c matches the Letter production according to the XML specification.

Definition at line 525 of file Teuchos_XMLParser.cpp.

bool XMLParser::isNameChar ( unsigned char  c) [inline, static, private]

Determine whether c matches the NameChar production according to the XML specification.

Definition at line 536 of file Teuchos_XMLParser.cpp.

bool XMLParser::isChar ( unsigned char  c) [inline, static, private]

Determine whether c matches the Char production according to the XML specification.

Definition at line 555 of file Teuchos_XMLParser.cpp.

bool XMLParser::isSpace ( unsigned char  c) [inline, static, private]

Determine whether c matches the Space production according to the XML specification.

Definition at line 546 of file Teuchos_XMLParser.cpp.

void XMLParser::getETag ( std::string &  tag) [private]

Consume a ETag production according to the XML specification. getETag throws an std::exception if the input does not match the production rule.

Parameters:
tag[out] On output, will be set to the tag name of the closing tag.

Definition at line 232 of file Teuchos_XMLParser.cpp.

void XMLParser::getSTag ( unsigned char  lookahead,
std::string &  tag,
Teuchos::map< std::string, string > &  attrs,
bool &  emptytag 
) [private]

Consume a STag production according to the XML specification. getSTag throws an std::exception if the input does not match the production rule.

Parameters:
lookahead[in] Contains the first character of the tag name.
tag[out] On output, will be set to the tag name of the opening tag.
attrs[out] On output, contains the attributes of the tag.
emptytag[out] On output, specifies if this was an empty element tag.

Definition at line 270 of file Teuchos_XMLParser.cpp.

void XMLParser::getComment ( ) [private]

Consume a Comment production according to the XML specification. getComment throws an std::exception if the input does not match the production rule.

Definition at line 417 of file Teuchos_XMLParser.cpp.

int XMLParser::getSpace ( unsigned char &  lookahead) [private]

Consumes a Space (block of whitepace) production according to the XML specification.

Parameters:
lookahead[out] On output, specifies the first character after the whitespace.
Returns:
Returns non-zero if the input stream was exhausted while reading whitespace.

Definition at line 513 of file Teuchos_XMLParser.cpp.

void XMLParser::getReference ( std::string &  refstr) [private]

Consumes a Reference production according to the XML specification.

Parameters:
refstr[out] On output, specifies the decoded reference.

Definition at line 450 of file Teuchos_XMLParser.cpp.

int XMLParser::assertChar ( unsigned char  cexp) [private]

Determines if the next character on the stream.

Parameters:
cexp[in] The expected character.
Returns:
Returns non-zero if the next character on the stream is not cexp.

Definition at line 563 of file Teuchos_XMLParser.cpp.


Member Data Documentation

Definition at line 79 of file Teuchos_XMLParser.hpp.

Teuchos::map<std::string,string> Teuchos::XMLParser::_entities [private]

Definition at line 80 of file Teuchos_XMLParser.hpp.


The documentation for this class was generated from the following files:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines