Quick Links: |
#include <balxml_listparser.h>
Public Types | |
typedef int(* | ParseElementFunction )(ElementType *, const char *, int) |
typedef bsl::function< int(ElementType *, const char *, int) | ParseElementCallback ) |
Public Member Functions | |
ListParser (ParseElementCallback parseElementCallback, bslma::Allocator *basicAllocator=0) | |
int | beginParse (TYPE *object) |
int | endParse () |
template<class INPUT_ITERATOR > | |
int | pushCharacters (INPUT_ITERATOR begin, INPUT_ITERATOR end) |
This is a push parser for lists.
See Component balxml_listparser
typedef int(* balxml::ListParser< TYPE >::ParseElementFunction)(ElementType *, const char *, int) |
typedef bsl::function<int(ElementType*, const char*, int) balxml::ListParser< TYPE >::ParseElementCallback) |
balxml::ListParser< TYPE >::ListParser | ( | ParseElementCallback | parseElementCallback, | |
bslma::Allocator * | basicAllocator = 0 | |||
) | [explicit] |
Create a parser for lists using the specified parseElementCallback
functor to parse each element and the optionally specified basicAllocator
for supplying memory. If basicAllocator
is 0, the currently installed default allocator will be used.
int balxml::ListParser< TYPE >::beginParse | ( | TYPE * | object | ) |
Prepare the parser to start parsing a new value and associate the specified object
with the parser. Return 0 if successful and non-zero otherwise.
int balxml::ListParser< TYPE >::endParse | ( | ) |
Ends the parse operation and store the value parsed from the pushed characters into the associated object. Return 0 if successful and non-zero otherwise. The behavior is undefined unless an object is associated with this parser. Upon successful completion, the parser will be disassociated with the object.
int balxml::ListParser< TYPE >::pushCharacters | ( | INPUT_ITERATOR | begin, | |
INPUT_ITERATOR | end | |||
) |
Push the characters ranging from the specified begin
up to (but not including) the specified end
into this parser. Return 0 if successful and non-zero otherwise. The parameterized INPUT_ITERATOR
must be dereferenceable to a char
value. The behavior is undefined unless an object is associated with this parser.