textwolf  0.2
Classes | Public Member Functions | List of all members
textwolf::TextScanner< Iterator, CharSet > Class Template Reference

Reader for scanning the input character by character. More...

#include <textscanner.hpp>

Classes

class  ControlCharMap
 Map of ASCII characters to control character identifiers used in the XML scanner automaton. More...
 

Public Member Functions

 TextScanner (const CharSet &charset_)
 Constructor. More...
 
 TextScanner (const CharSet &charset_, const Iterator &p_iterator)
 
 TextScanner (const Iterator &p_iterator)
 
 TextScanner (const TextScanner &orig)
 Copy constructor. More...
 
template<class IteratorAssignment >
void setSource (const IteratorAssignment &a)
 Assign something to the iterator while keeping the state. More...
 
std::size_t getPosition () const
 Get the current source iterator position. More...
 
UChar chr ()
 Get the unicode representation of the current character. More...
 
void getcur ()
 Fill the internal buffer with as many current character bytes needed for reading the ASCII representation. More...
 
const Iterator & getIterator () const
 Get the iterator pointing to the current source position. More...
 
Iterator & getIterator ()
 Get the iterator pointing to the current source position. More...
 
template<class Buffer >
void copychar (CharSet &output_, Buffer &buf_)
 
ControlCharacter control ()
 Get the control character representation of the current character. More...
 
unsigned char ascii ()
 Get the ASCII character representation of the current character. More...
 
TextScannerskip ()
 Skip to the next character of the source. More...
 
UChar operator* ()
 see TextScanner::chr() More...
 
TextScanneroperator++ ()
 Preincrement: Skip to the next character of the source. More...
 
TextScanner operator++ (int)
 Postincrement: Skip to the next character of the source. More...
 

Detailed Description

template<typename Iterator, class CharSet>
class textwolf::TextScanner< Iterator, CharSet >

Reader for scanning the input character by character.

Template Parameters
Iteratorsource iterator type (implements preincrement and '*' input byte access indirection)
CharSetcharacter set of the source stream

Constructor & Destructor Documentation

template<typename Iterator, class CharSet>
textwolf::TextScanner< Iterator, CharSet >::TextScanner ( const CharSet &  charset_)
inline

Constructor.

template<typename Iterator, class CharSet>
textwolf::TextScanner< Iterator, CharSet >::TextScanner ( const CharSet &  charset_,
const Iterator &  p_iterator 
)
inline
template<typename Iterator, class CharSet>
textwolf::TextScanner< Iterator, CharSet >::TextScanner ( const Iterator &  p_iterator)
inline
template<typename Iterator, class CharSet>
textwolf::TextScanner< Iterator, CharSet >::TextScanner ( const TextScanner< Iterator, CharSet > &  orig)
inline

Copy constructor.

Parameters
[in]origtextscanner to copy

Member Function Documentation

template<typename Iterator, class CharSet>
unsigned char textwolf::TextScanner< Iterator, CharSet >::ascii ( )
inline

Get the ASCII character representation of the current character.

Returns
the ASCII character or 0 if not defined
template<typename Iterator, class CharSet>
UChar textwolf::TextScanner< Iterator, CharSet >::chr ( )
inline

Get the unicode representation of the current character.

Returns
the unicode character
template<typename Iterator, class CharSet>
ControlCharacter textwolf::TextScanner< Iterator, CharSet >::control ( )
inline

Get the control character representation of the current character.

Returns
the control character
template<typename Iterator, class CharSet>
template<class Buffer >
void textwolf::TextScanner< Iterator, CharSet >::copychar ( CharSet &  output_,
Buffer &  buf_ 
)
inline
Remarks
a check if the character sets fulfill is_equal(..) (IsoLatin code page !)
template<typename Iterator, class CharSet>
void textwolf::TextScanner< Iterator, CharSet >::getcur ( )
inline

Fill the internal buffer with as many current character bytes needed for reading the ASCII representation.

template<typename Iterator, class CharSet>
const Iterator& textwolf::TextScanner< Iterator, CharSet >::getIterator ( ) const
inline

Get the iterator pointing to the current source position.

template<typename Iterator, class CharSet>
Iterator& textwolf::TextScanner< Iterator, CharSet >::getIterator ( )
inline

Get the iterator pointing to the current source position.

template<typename Iterator, class CharSet>
std::size_t textwolf::TextScanner< Iterator, CharSet >::getPosition ( ) const
inline

Get the current source iterator position.

Returns
source iterator position in character words (usually bytes)
template<typename Iterator, class CharSet>
UChar textwolf::TextScanner< Iterator, CharSet >::operator* ( )
inline
template<typename Iterator, class CharSet>
TextScanner& textwolf::TextScanner< Iterator, CharSet >::operator++ ( )
inline

Preincrement: Skip to the next character of the source.

Returns
*this
template<typename Iterator, class CharSet>
TextScanner textwolf::TextScanner< Iterator, CharSet >::operator++ ( int  )
inline

Postincrement: Skip to the next character of the source.

Returns
*this
template<typename Iterator, class CharSet>
template<class IteratorAssignment >
void textwolf::TextScanner< Iterator, CharSet >::setSource ( const IteratorAssignment &  a)
inline

Assign something to the iterator while keeping the state.

Parameters
[in]asource iterator assignment
template<typename Iterator, class CharSet>
TextScanner& textwolf::TextScanner< Iterator, CharSet >::skip ( )
inline

Skip to the next character of the source.

Returns
*this

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