textwolf  0.2
Public Member Functions | List of all members
textwolf::SrcIterator Class Reference

Input iterator as source for the XML scanner with the possibility of being fed chunk by chunk. More...

#include <sourceiterator.hpp>

Inheritance diagram for textwolf::SrcIterator:
textwolf::throws_exception

Public Member Functions

 SrcIterator ()
 Empty constructor. More...
 
 SrcIterator (const SrcIterator &o)
 Copy constructor. More...
 
 SrcIterator (const char *buf, std::size_t size, jmp_buf *eom_=0)
 Constructor. More...
 
SrcIteratoroperator= (const SrcIterator &o)
 Assingment operator. More...
 
char operator* ()
 Element access operator (required by textwolf for an input iterator) More...
 
SrcIteratoroperator++ ()
 Prefix increment operator (required by textwolf for an input iterator) More...
 
std::size_t operator- (const SrcIterator &b) const
 Get the iterator difference in bytes. More...
 
void putInput (const char *buf, std::size_t size, jmp_buf *eom=0)
 Feed input to the source iterator. More...
 
std::size_t getPosition () const
 Get the current position in the current chunk parsed. More...
 
PositionIndex position () const
 
bool endOfChunk () const
 

Additional Inherited Members

- Public Types inherited from textwolf::throws_exception
enum  Cause {
  Unknown, DimOutOfRange, StateNumbersNotAscending, InvalidParamState,
  InvalidParamChar, DuplicateStateTransition, InvalidState, IllegalParam,
  IllegalAttributeName, OutOfMem, ArrayBoundsReadWrite, NotAllowedOperation,
  FileReadError, IllegalXmlHeader, InvalidTagOffset, CorruptTagStack,
  CodePageIndexNotSupported
}
 Enumeration of error cases. More...
 

Detailed Description

Input iterator as source for the XML scanner with the possibility of being fed chunk by chunk.

Constructor & Destructor Documentation

textwolf::SrcIterator::SrcIterator ( )
inline

Empty constructor.

textwolf::SrcIterator::SrcIterator ( const SrcIterator o)
inline

Copy constructor.

Parameters
[in]oiterator to copy
textwolf::SrcIterator::SrcIterator ( const char *  buf,
std::size_t  size,
jmp_buf *  eom_ = 0 
)
inline

Constructor.

Parameters
[in]bufsource chunk to iterate on
[in]sizesize of source chunk to iterate on in bytes
[in]eom_trigger to activate if end of data has been reached (no next chunk anymore)

Member Function Documentation

bool textwolf::SrcIterator::endOfChunk ( ) const
inline
std::size_t textwolf::SrcIterator::getPosition ( ) const
inline

Get the current position in the current chunk parsed.

Remarks
Does not return the absolute position in the source parsed but the position in the chunk
char textwolf::SrcIterator::operator* ( )
inline

Element access operator (required by textwolf for an input iterator)

SrcIterator& textwolf::SrcIterator::operator++ ( )
inline

Prefix increment operator (required by textwolf for an input iterator)

std::size_t textwolf::SrcIterator::operator- ( const SrcIterator b) const
inline

Get the iterator difference in bytes.

SrcIterator& textwolf::SrcIterator::operator= ( const SrcIterator o)
inline

Assingment operator.

PositionIndex textwolf::SrcIterator::position ( ) const
inline
void textwolf::SrcIterator::putInput ( const char *  buf,
std::size_t  size,
jmp_buf *  eom = 0 
)
inline

Feed input to the source iterator.

Parameters
[in]bufpoiner to start of input
[in]sizesize of input passed in bytes
[in]eomlongjmp to call with parameter 1, if the end of data has been reached before EOF (null termination), eom=null, if the chunk passed contains the complete reset of the input and eof (null) can be returned if we reach the end

The documentation for this class was generated from the following file: