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