26 #ifndef __TERRALIB_XERCES_INTERNAL_READER_H
27 #define __TERRALIB_XERCES_INTERNAL_READER_H
30 #include "../xml/Reader.h"
37 #include <xercesc/util/XercesDefs.hpp>
40 XERCES_CPP_NAMESPACE_BEGIN
44 XERCES_CPP_NAMESPACE_END
88 void read(
const std::string& fileURI);
110 std::string
getAttr(
const std::string& name)
const;
124 void getNamespace(std::size_t i, std::pair<std::string, std::string>& ns)
const;
This class implements Xerces interface for error handlers.
This class implements Xerces interface for a handler that receives general document events.
A class that models a XML reader object built on top of Xerces-C++.
void setDoNamespaces(bool d)
It enables or disables the parser namespace processing.
std::string getAttrQName(std::size_t i) const
It returns the qualified name for the i-th attribute.
void setValidationScheme(bool d)
If true the parser will perform a validation scheme.
void read(const std::string &fileURI)
It prepare the given file to be read.
bool m_ignoreWhiteSpaces
A flag that indicates if the parser should ignore white spaces.
void setCacheGrammarFromParse(bool d)
If true it caches the grammar in the pool for re-use in subsequent parses.
void setInternalBufferSize(const std::size_t size)
It sets the maximal allowed buffer size used for parsing.
std::string getAttr(std::size_t i) const
It returns the attribute value in the case of an element node with valid attributes.
void setIgnoreWhiteSpaces(bool d)
If true the parser will ignore the white space characters.
std::string getElementLocalName() const
It returns the local part of the element name in the case of an element node.
void reset()
It resets the parser.
std::string getElementValue() const
It returns the element data value in the case of VALUE node.
bool next()
It gets the next event to be read.
bool hasAttrs() const
It tells if the element has attributes in the case of an element node.
xercesc::XMLPScanToken * m_token
This keeps the parser state.
void setDoSchema(bool d)
It enables or disables the parser schema processing.
std::string getElementURI() const
It returns the URI of the associated namespace in the case of an element node.
std::string getAttrURI(std::size_t i) const
It returns the attribute URI of the associated namespace in the case of an element node.
te::xml::NodeType getNodeType() const
It return the type of node read.
std::size_t getElementDataLen() const
It returns the element data value in the case of VALUE node.
xercesc::SAX2XMLReader * m_parser
A pointer to the parser used by the reader.
std::size_t getNumberOfNamespaces() const
std::string getAttr(const std::string &name) const
It returns the attribute value in the case of an element node with valid attributes.
ReaderHandler * m_readerH
A pointer to a content handler.
std::string getAttrLocalName(std::size_t i) const
It returns the local part of the attribute name for the i-th attribute.
std::string getElementQName() const
It returns the qualified name in the case of an element node.
std::size_t getNumberOfAttrs() const
It returns the number of attributes in the case of an element node.
void setUseCachedGrammarInParse(bool d)
If true the reader will use cached grammar if it exists in the pool.
void getNamespace(std::size_t i, std::pair< std::string, std::string > &ns) const
std::size_t getAttrPosition(const std::string &name) const
It returns the attribute position.
ErrorHandler * m_errH
A pointer to an error handler.
void readFromContent(const std::string &content) override
It prepare the given content to be read.
Reader()
Default constructor.
This class models a XML reader object.
NodeType
The type of node read by XML reader.
Proxy configuration file for TerraView (see terraview_config.h).