textwolf
0.2
|
XML scanner template that adds the functionality to the statemachine base definition. More...
#include <xmlscanner.hpp>
Classes | |
class | End |
end of input tag More... | |
class | iterator |
input iterator for iterating on the output of an XML scanner More... | |
Public Member Functions | |
XMLScanner (const InputIterator &p_src, const EntityMap &p_entityMap) | |
Constructor. More... | |
XMLScanner (const InputIterator &p_src) | |
Constructor. More... | |
XMLScanner (const InputCharSet &p_charset, const InputIterator &p_src, const EntityMap &p_entityMap) | |
Constructor. More... | |
XMLScanner (const InputCharSet &p_charset, const InputIterator &p_src) | |
Constructor. More... | |
XMLScanner (const InputCharSet &p_charset) | |
Constructor. More... | |
XMLScanner () | |
Default constructor. More... | |
XMLScanner (const XMLScanner &o) | |
Copy constructor. More... | |
template<class IteratorAssignment > | |
void | setSource (const IteratorAssignment &a) |
Assign something to the source iterator while keeping the state. More... | |
std::size_t | getPosition () const |
Get the current source iterator position. More... | |
std::size_t | getTokenPosition () const |
Get the current token position. More... | |
const char * | getItemPtr () const |
Get the current parsed XML element pointer, if it was not masked out, see nextItem(unsigned short) More... | |
std::size_t | getItemSize () const |
Get the size of the current parsed XML element in bytes. More... | |
const OutputBuffer & | getItem () const |
Get the current parsed XML element, if it was not masked out, see nextItem(unsigned short) More... | |
ScannerStatemachine::Element * | getState () |
Get the current XML scanner state machine state. More... | |
Error | getError (const char **str=0) |
Get the last error. More... | |
const InputIterator & | getIterator () const |
Get the iterator pointing to the current source position. More... | |
InputIterator & | getIterator () |
Get the iterator pointing to the current source position. More... | |
ElementType | nextItem (unsigned short mask=0xFFFF) |
Scan the next XML element. More... | |
iterator | begin (bool doSkipToFirst=true) |
Get begin iterator. More... | |
iterator | end () |
Get the pointer to the end of content. More... | |
Static Public Member Functions | |
template<class OutputBufferType > | |
static bool | parseStaticToken (const IsTokenCharMap &isTok, InputReader ir, OutputBufferType &buf) |
Static version of parse a token for parsing table definition elements. More... | |
Static Public Member Functions inherited from textwolf::XMLScannerBase | |
static const char * | getElementTypeName (ElementType ee) |
Get the XML element type as string. More... | |
static const char * | getErrorString (Error ee) |
Get the error code as string. More... | |
static const char * | getStateString (STMState s) |
Get the scanner state machine state as string. More... | |
static const char * | getActionString (STMAction a) |
Get the scanner state machine action as string. More... | |
XML scanner template that adds the functionality to the statemachine base definition.
InputIterator | input iterator with ++ and read only * returning 0 als last character of the input |
InputCharSet_ | character set encoding of the input, read as stream of bytes |
OutputCharSet_ | character set encoding of the output, printed as string of the item type of the character set, |
OutputBuffer_ | buffer for output with STL back insertion sequence interface (e.g. std::string,std::vector<char>,textwolf::StaticBuffer) |
typedef std::map<const char*,UChar> textwolf::XMLScanner< InputIterator, InputCharSet_, OutputCharSet_, OutputBuffer_ >::EntityMap |
typedef InputCharSet_ textwolf::XMLScanner< InputIterator, InputCharSet_, OutputCharSet_, OutputBuffer_ >::InputCharSet |
typedef TextScanner<InputIterator,InputCharSet_> textwolf::XMLScanner< InputIterator, InputCharSet_, OutputCharSet_, OutputBuffer_ >::InputReader |
typedef OutputBuffer_ textwolf::XMLScanner< InputIterator, InputCharSet_, OutputCharSet_, OutputBuffer_ >::OutputBuffer |
typedef OutputCharSet_ textwolf::XMLScanner< InputIterator, InputCharSet_, OutputCharSet_, OutputBuffer_ >::OutputCharSet |
typedef XMLScanner<InputIterator,InputCharSet_,OutputCharSet_,OutputBuffer_> textwolf::XMLScanner< InputIterator, InputCharSet_, OutputCharSet_, OutputBuffer_ >::ThisXMLScanner |
|
inline |
Constructor.
[in] | p_src | source iterator |
[in] | p_entityMap | read only map of named entities defined by the user |
|
inlineexplicit |
Constructor.
[in] | p_src | source iterator |
|
inline |
Constructor.
[in] | p_charset | character set encoding of input in case of non default settings (code page) needed |
[in] | p_src | source iterator |
[in] | p_entityMap | read only map of named entities defined by the user |
|
inline |
Constructor.
[in] | p_charset | character set encoding of input in case of non default settings (code page) needed |
[in] | p_src | source iterator |
|
inlineexplicit |
Constructor.
[in] | p_charset | character set encoding of input in case of non default settings (code page) needed |
|
inline |
Default constructor.
|
inline |
Copy constructor.
[in] | o | scanner to copy |
|
inline |
Get begin iterator.
[in] | doSkipToFirst | true, if the iterator should skip to the first character of the input (default behaviour of STL conform iterators but maybe not exception save) |
|
inline |
Get the pointer to the end of content.
|
inline |
Get the last error.
[out] | str | the error as string |
|
inline |
Get the current parsed XML element, if it was not masked out, see nextItem(unsigned short)
|
inline |
Get the current parsed XML element pointer, if it was not masked out, see nextItem(unsigned short)
|
inline |
Get the size of the current parsed XML element in bytes.
|
inline |
Get the iterator pointing to the current source position.
|
inline |
Get the iterator pointing to the current source position.
|
inline |
Get the current source iterator position.
|
inline |
Get the current XML scanner state machine state.
|
inline |
Get the current token position.
|
inline |
Scan the next XML element.
[in] | mask | element types that should be printed to the output buffer (1 -> print, 0 -> mask out, just return the element as event) |
|
inlinestatic |
Static version of parse a token for parsing table definition elements.
OutputBufferType | type buffer for output |
[in] | isTok | set of valid token characters |
[in] | ir | input reader iterator |
[out] | buf | buffer where to write the result to |
|
inline |
Assign something to the source iterator while keeping the state.
[in] | a | source iterator assignment |