A class that models a XML reader object built on top of Xerces-C++. More...
#include <Reader.h>
Public Member Functions | |
std::string | getAttr (const std::string &name) const |
It returns the attribute value in the case of an element node with valid attributes. More... | |
std::string | getAttr (std::size_t i) const |
It returns the attribute value in the case of an element node with valid attributes. More... | |
virtual double | getAttrAsDouble (const std::string &name) const |
It returns the attribute value in the case of an element node with valid attributes. More... | |
virtual double | getAttrAsDouble (std::size_t i) const |
It returns the attribute value in the case of an element node with valid attributes. More... | |
virtual boost::int32_t | getAttrAsInt32 (const std::string &name) const |
It returns the attribute value in the case of an element node with valid attributes. More... | |
virtual boost::int32_t | getAttrAsInt32 (std::size_t i) const |
It returns the attribute value in the case of an element node with valid attributes. More... | |
virtual boost::uint32_t | getAttrAsUInt32 (std::size_t i) const |
It returns the attribute value in the case of an element node with valid attributes. More... | |
virtual boost::uint32_t | getAttrAsUInt32 (const std::string name) const |
It returns the attribute value in the case of an element node with valid attributes. More... | |
std::string | getAttrLocalName (std::size_t i) const |
It returns the local part of the attribute name for the i-th attribute. More... | |
std::size_t | getAttrPosition (const std::string &name) const |
It returns the attribute position. More... | |
std::string | getAttrQName (std::size_t i) const |
It returns the qualified name for the i-th attribute. More... | |
std::string | getAttrURI (std::size_t i) const |
It returns the attribute URI of the associated namespace in the case of an element node. More... | |
std::size_t | getElementDataLen () const |
It returns the element data value in the case of VALUE node. More... | |
std::string | getElementLocalName () const |
It returns the local part of the element name in the case of an element node. More... | |
std::string | getElementQName () const |
It returns the qualified name in the case of an element node. More... | |
std::string | getElementURI () const |
It returns the URI of the associated namespace in the case of an element node. More... | |
std::string | getElementValue () const |
It returns the element data value in the case of VALUE node. More... | |
virtual bool | getElementValueAsBoolean () const |
It returns the element data value in the case of VALUE node. More... | |
virtual double | getElementValueAsDouble () const |
It returns the element data value in the case of VALUE node. More... | |
virtual boost::int32_t | getElementValueAsInt32 () const |
It returns the element data value in the case of VALUE node. More... | |
void | getNamespace (std::size_t i, std::pair< std::string, std::string > &ns) const |
te::xml::NodeType | getNodeType () const |
It return the type of node read. More... | |
std::size_t | getNumberOfAttrs () const |
It returns the number of attributes in the case of an element node. More... | |
std::size_t | getNumberOfNamespaces () const |
bool | hasAttrs () const |
It tells if the element has attributes in the case of an element node. More... | |
bool | next () |
It gets the next event to be read. More... | |
void | read (const std::string &fileURI) |
It prepare the given file to be read. More... | |
Reader () | |
Default constructor. More... | |
void | reset () |
It resets the parser. More... | |
void | setCacheGrammarFromParse (bool d) |
If true it caches the grammar in the pool for re-use in subsequent parses. More... | |
void | setDoNamespaces (bool d) |
It enables or disables the parser namespace processing. More... | |
void | setDoSchema (bool d) |
It enables or disables the parser schema processing. More... | |
void | setIgnoreWhiteSpaces (bool d) |
If true the parser will ignore the white space characters. More... | |
void | setInternalBufferSize (const std::size_t size) |
It sets the maximal allowed buffer size used for parsing. More... | |
void | setUseCachedGrammarInParse (bool d) |
If true the reader will use cached grammar if it exists in the pool. More... | |
void | setValidationScheme (bool d) |
If true the parser will perform a validation scheme. More... | |
~Reader () | |
Destructor. More... | |
Private Attributes | |
ErrorHandler * | m_errH |
A pointer to an error handler. More... | |
bool | m_ignoreWhiteSpaces |
A flag that indicates if the parser should ignore white spaces. More... | |
xercesc::SAX2XMLReader * | m_parser |
A pointer to the parser used by the reader. More... | |
ReaderHandler * | m_readerH |
A pointer to a content handler. More... | |
xercesc::XMLPScanToken * | m_token |
This keeps the parser state. More... | |
A class that models a XML reader object built on top of Xerces-C++.
This API is intend to simplify the task of reading XML files. We have tried to model it close to the Libxml2 API (see http://xmlsoft.org/xmlreader.html for more information) but keeping all Xerces-C++ support capabilities: schema validation and grammar cache.
If you prefer to use the SAX or DOM parsers, please, look the Xerces-C++ documentation available at http://xerces.apache.org/xerces-c.
te::xerces::Reader::Reader | ( | ) |
Default constructor.
|
virtual |
Destructor.
Reimplemented from te::xml::Reader.
|
virtual |
It returns the attribute value in the case of an element node with valid attributes.
name | The attribute name. |
Implements te::xml::Reader.
|
virtual |
It returns the attribute value in the case of an element node with valid attributes.
i | The attribute position. |
Implements te::xml::Reader.
|
virtualinherited |
It returns the attribute value in the case of an element node with valid attributes.
name | The attribute name. |
|
virtualinherited |
It returns the attribute value in the case of an element node with valid attributes.
i | The attribute position. |
|
virtualinherited |
It returns the attribute value in the case of an element node with valid attributes.
name | The attribute name. |
|
virtualinherited |
It returns the attribute value in the case of an element node with valid attributes.
i | The attribute position. |
|
virtualinherited |
It returns the attribute value in the case of an element node with valid attributes.
i | The attribute position. |
|
virtualinherited |
It returns the attribute value in the case of an element node with valid attributes.
name | The attribute name. |
|
virtual |
It returns the local part of the attribute name for the i-th attribute.
i | The attribute position index. |
Implements te::xml::Reader.
|
virtual |
It returns the attribute position.
name | The attribute name. |
Implements te::xml::Reader.
|
virtual |
It returns the qualified name for the i-th attribute.
i | The attribute position index. |
Implements te::xml::Reader.
|
virtual |
It returns the attribute URI of the associated namespace in the case of an element node.
i | The attribute position index. |
Implements te::xml::Reader.
|
virtual |
It returns the element data value in the case of VALUE node.
It returns the element data value length in the case of VALUE or CDATA node.
Implements te::xml::Reader.
|
virtual |
It returns the local part of the element name in the case of an element node.
Implements te::xml::Reader.
|
virtual |
It returns the qualified name in the case of an element node.
Implements te::xml::Reader.
|
virtual |
It returns the URI of the associated namespace in the case of an element node.
Implements te::xml::Reader.
|
virtual |
It returns the element data value in the case of VALUE node.
Implements te::xml::Reader.
|
virtualinherited |
It returns the element data value in the case of VALUE node.
|
virtualinherited |
It returns the element data value in the case of VALUE node.
|
virtualinherited |
It returns the element data value in the case of VALUE node.
|
virtual |
Implements te::xml::Reader.
|
virtual |
|
virtual |
It returns the number of attributes in the case of an element node.
Implements te::xml::Reader.
|
virtual |
Implements te::xml::Reader.
|
virtual |
It tells if the element has attributes in the case of an element node.
Implements te::xml::Reader.
|
virtual |
It gets the next event to be read.
Exception | It throws an exception if something goes wrong during the text read. |
Implements te::xml::Reader.
|
virtual |
It prepare the given file to be read.
You must call read to start parsing the XML document.
fileURI | A path to a XML file or any URI where it can be found. |
Exception | It throws an exception if the file doesn't exist or if the internal parser can not read it. |
Implements te::xml::Reader.
void te::xerces::Reader::reset | ( | ) |
It resets the parser.
Exception | It throws an exception if it is not possible to reset the parser. |
|
virtual |
If true it caches the grammar in the pool for re-use in subsequent parses.
d | If If true it caches the grammar in the pool for re-use in subsequent parses. |
Implements te::xml::Reader.
|
virtual |
It enables or disables the parser namespace processing.
d | If true the internal parser will perform the namespace processing otherwise this will not be done. |
Implements te::xml::Reader.
|
virtual |
It enables or disables the parser schema processing.
d | If true the internal parser will perform the schema processing otherwise this will not be done. |
Implements te::xml::Reader.
|
virtual |
If true the parser will ignore the white space characters.
d | If true the parser will ignore the white space characters. |
Implements te::xml::Reader.
|
virtual |
It sets the maximal allowed buffer size used for parsing.
size | The maximal allowed buffer size used for parsing. |
Implements te::xml::Reader.
|
virtual |
If true the reader will use cached grammar if it exists in the pool.
d | If true the reader will use cached grammar if it exists in the pool. |
Implements te::xml::Reader.
|
virtual |
If true the parser will perform a validation scheme.
d | If true the parser will perform a validation scheme. |
Implements te::xml::Reader.
|
private |
|
private |
|
private |
|
private |
|
private |