11 #ifndef __TEXTWOLF_SOURCE_ITERATOR_HPP__
12 #define __TEXTWOLF_SOURCE_ITERATOR_HPP__
44 ,m_abspos(o.m_abspos){}
50 SrcIterator(
const char* buf, std::size_t size, jmp_buf* eom_=0)
51 :m_start(const_cast<char*>(buf))
52 ,m_itr(const_cast<char*>(buf))
64 m_abspos = o.m_abspos;
73 if (m_eom) longjmp(*m_eom,1);
90 return m_itr - b.m_itr;
97 void putInput(
const char* buf, std::size_t size, jmp_buf* eom=0)
100 m_start = m_itr =
const_cast<char*
>(buf);
109 return (m_end >= m_itr)?(m_itr-m_start):0;
114 return m_abspos - (m_end - m_itr);
119 return (m_itr >= m_end);
SrcIterator(const char *buf, std::size_t size, jmp_buf *eom_=0)
Constructor.
Definition: sourceiterator.hpp:50
SrcIterator & operator=(const SrcIterator &o)
Assingment operator.
Definition: sourceiterator.hpp:58
SrcIterator & operator++()
Prefix increment operator (required by textwolf for an input iterator)
Definition: sourceiterator.hpp:80
Input iterator as source for the XML scanner with the possibility of being fed chunk by chunk...
Definition: sourceiterator.hpp:25
Base class for structures that can throw exceptions for non recoverable errors.
Definition: exception.hpp:20
PositionIndex position() const
Definition: sourceiterator.hpp:112
char operator*()
Element access operator (required by textwolf for an input iterator)
Definition: sourceiterator.hpp:69
SrcIterator(const SrcIterator &o)
Copy constructor.
Definition: sourceiterator.hpp:39
void putInput(const char *buf, std::size_t size, jmp_buf *eom=0)
Feed input to the source iterator.
Definition: sourceiterator.hpp:97
parameter check in automaton definition failed. Internal textwolf error
Definition: exception.hpp:33
textwolf exception class
Definition: exception.hpp:48
Definition of exceptions with containing error codes thrown by textwolf.
Definition of position number in source.
SrcIterator()
Empty constructor.
Definition: sourceiterator.hpp:30
bool endOfChunk() const
Definition: sourceiterator.hpp:117
std::size_t getPosition() const
Get the current position in the current chunk parsed.
Definition: sourceiterator.hpp:107
uint64_t PositionIndex
Definition: position.hpp:34
std::size_t operator-(const SrcIterator &b) const
Get the iterator difference in bytes.
Definition: sourceiterator.hpp:87