29#ifndef Pt_Xml_XmlReader_h
30#define Pt_Xml_XmlReader_h
32#include <Pt/Xml/Api.h>
33#include <Pt/Xml/Node.h>
35#include <Pt/NonCopyable.h>
214 class XmlReaderImpl* _impl;
217 XmlReaderImpl* impl()
238 { _node = &_stream->get(); }
243 : _stream(it._stream), _node(it._node)
255 _stream = it._stream;
274 if(_node->type() == Node::EndDocument)
277 _node = &_stream->next();
285 {
return _node == it._node; }
290 {
return _node != it._node; }
NonCopyable()
Default constructor.
Definition NonCopyable.h:63
The DocTypeDefinition of an XML document.
Definition DocTypeDefinition.h:58
XML document node.
Definition Node.h:51
Reads XML as a Stream of XML Nodes.
Definition XmlReader.h:80
Node * advance()
Process availabe data from underlying input source.
InputIterator end() const
Returns an iterator to the end of the document.
Definition XmlReader.h:304
void reset(InputSource &is)
Starts parsing with an input source.
void setMaxInputDepth(std::size_t n)
Sets the max expansion depth of input sources.
Node & next()
Get next node.
std::size_t maxSize() const
Returns the number of characters the parser may allocate.
void addInput(InputSource &in)
Adds an external input source.
XmlReader(InputSource &is)
Construct with input source.
void reportEntityReferences(bool value)
Configures the parser to report entity references.
void reportProcessingInstructions(bool value)
Configures the parser to report processing instructions.
const DocTypeDefinition & dtd() const
Returns current DTD of the document.
std::size_t line() const
Returns the current line of the primary input source.
InputIterator current()
Returns an iterator to the current node.
Definition XmlReader.h:298
void reportDocType(bool value)
Configures the parser to report DOCTYPEs.
InputSource * input()
Returns the current input source or nullptr if none is set.
void reportComments(bool value)
Configures the parser to report comments.
XmlReader(XmlResolver &r, InputSource &is)
Construct with resolver and input source.
void reportStartDocument(bool value)
Configures the parser to report the start of the document.
std::size_t depth() const
Returns the XML tree depth.
void setMaxSize(std::size_t n)
Sets the max number of characters the parser may allocate.
void reset()
Clears the reader state and input.
void setChunkSize(std::size_t n)
Sets the max size of a characters block.
XmlReader()
Default Constructor.
Node & get()
Get current node.
DocTypeDefinition & dtd()
Returns current DTD of the document.
XmlResolver * resolver() const
Returns the resolver or nullptr is none was set.
void reportCData(bool value)
Configures the parser to report CDATA sections.
std::size_t usedSize() const
Returns the number of characters the parser has allocated.
Resolves external entities and DTDs.
Definition XmlResolver.h:54
Read and write XML ducuments.
Core module.
Definition Allocator.h:33