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);
108 std::string
getAttr(
const std::string& name)
const;
110 std::string
getAttr(std::size_t i)
const;
122 void getNamespace(std::size_t i, std::pair<std::string, std::string>& ns)
const;
147 #endif // __TERRALIB_XERCES_INTERNAL_READER_H
std::string getAttrLocalName(std::size_t i) const
It returns the local part of the attribute name for the i-th attribute.
A class that models a XML reader object built on top of Xerces-C++.
bool next()
It gets the next event to be read.
This class models a XML reader object.
std::string getElementURI() const
It returns the URI of the associated namespace in the case of an element node.
bool m_ignoreWhiteSpaces
A flag that indicates if the parser should ignore white spaces.
void setDoNamespaces(bool d)
It enables or disables the parser namespace processing.
Reader()
Default constructor.
std::size_t getAttrPosition(const std::string &name) const
It returns the attribute position.
void setIgnoreWhiteSpaces(bool d)
If true the parser will ignore the white space characters.
std::string getAttrURI(std::size_t i) const
It returns the attribute URI of the associated namespace 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...
std::size_t getNumberOfNamespaces() const
xercesc::SAX2XMLReader * m_parser
A pointer to the parser used by the reader.
std::string getAttrQName(std::size_t i) const
It returns the qualified name for the i-th attribute.
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::string getElementLocalName() const
It returns the local part of the element name 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.
This class implements Xerces interface for error handlers.
void setUseCachedGrammarInParse(bool d)
If true the reader will use cached grammar if it exists in the pool.
std::string getElementQName() const
It returns the qualified name in the case of an element node.
void setDoSchema(bool d)
It enables or disables the parser schema processing.
std::string getElementValue() const
It returns the element data value in the case of VALUE node.
std::size_t getNumberOfAttrs() const
It returns the number of attributes in the case of an element node.
bool hasAttrs() const
It tells if the element has attributes 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.
void getNamespace(std::size_t i, std::pair< std::string, std::string > &ns) const
void reset()
It resets the parser.