Teuchos Package Browser (Single Doxygen Collection) Version of the Day
|
XMLParser consumes characters from an XMLInputStream object, parsing the XML and using a TreeBuildingXMLHandler to construct an XMLObject. More...
#include <Teuchos_XMLParser.hpp>
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 (long startLine) |
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. | |
void | ignoreXMLDeclaration () |
Ignore the rest of an XML declaration tag. | |
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 |
long | _lineNo |
XMLParser consumes characters from an XMLInputStream object, parsing the XML and using a TreeBuildingXMLHandler to construct an XMLObject.
Note: per the XML standard, certain characters must be represented with escape codes within fields:
character description code < less-than < & ampersand &
Definition at line 70 of file Teuchos_XMLParser.hpp.
|
inline |
Constructor.
Definition at line 75 of file Teuchos_XMLParser.hpp.
|
inline |
Destructor.
Definition at line 78 of file Teuchos_XMLParser.hpp.
XMLObject XMLParser::parse | ( | ) |
Consume the XMLInputStream to build an XMLObject.
Definition at line 137 of file Teuchos_XMLParser.cpp.
Determine whether c
matches the Letter
production according to the XML specification.
Definition at line 556 of file Teuchos_XMLParser.cpp.
Determine whether c
matches the NameChar
production according to the XML specification.
Definition at line 567 of file Teuchos_XMLParser.cpp.
Determine whether c
matches the Char
production according to the XML specification.
Definition at line 586 of file Teuchos_XMLParser.cpp.
Determine whether c
matches the Space
production according to the XML specification.
Definition at line 577 of file Teuchos_XMLParser.cpp.
|
private |
Consume a ETag
production according to the XML specification. getETag
throws an std::exception if the input does not match the production rule.
tag | [out] On output, will be set to the tag name of the closing tag. |
Definition at line 260 of file Teuchos_XMLParser.cpp.
|
private |
Consume a STag
production according to the XML specification. getSTag
throws an std::exception if the input does not match the production rule.
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 300 of file Teuchos_XMLParser.cpp.
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 445 of file Teuchos_XMLParser.cpp.
Consumes a Space
(block of whitepace) production according to the XML specification.
lookahead | [out] On output, specifies the first character after the whitespace. |
Definition at line 543 of file Teuchos_XMLParser.cpp.
|
private |
Consumes a Reference
production according to the XML specification.
refstr | [out] On output, specifies the decoded reference. |
Definition at line 479 of file Teuchos_XMLParser.cpp.
|
private |
Ignore the rest of an XML declaration tag.
Definition at line 609 of file Teuchos_XMLParser.cpp.
Determines if the next character on the stream.
cexp | [in] The expected character. |
cexp
. Definition at line 594 of file Teuchos_XMLParser.cpp.
|
private |
Definition at line 88 of file Teuchos_XMLParser.hpp.
|
private |
Definition at line 89 of file Teuchos_XMLParser.hpp.
|
private |
Definition at line 90 of file Teuchos_XMLParser.hpp.