Inherits YGP::ParseAttomic.
Inherited by YGP::CBParseToText, and YGP::OFParseToText< T >.
Public Member Functions | |
ParseToText (const char *text, const char *description, unsigned int max=1, unsigned int min=1, bool skipWhitespace=true) | |
ParseToText (const ParseToText &other) | |
virtual | ~ParseToText () |
ParseToText & | operator= (const ParseToText &other) |
virtual int | doParse (Xistream &stream, bool optional) throw (YGP::ParseError) |
Parsing of this element is stopped, after the specified text is found (or the maximal cardinality is reached).
The found()-method gets the name of the scanned text passed als first parameter and the number of found entries as second.
See ParseObject for a general description of the parser.
YGP::ParseToText::ParseToText | ( | const char * | text, | |
const char * | description, | |||
unsigned int | max = 1 , |
|||
unsigned int | min = 1 , |
|||
bool | skipWhitespace = true | |||
) | [inline] |
Constructor.
YGP::ParseToText::ParseToText | ( | const ParseToText & | other | ) | [inline] |
Copy constructor.
YGP::ParseToText::~ParseToText | ( | ) | [virtual] |
Destructor.
int YGP::ParseToText::doParse | ( | Xistream & | stream, | |
bool | optional | |||
) | throw (YGP::ParseError) [virtual] |
Tries to parse the object from the stream.
Returns PARSE_OK
if data matching the object is found (and the callback does not report something different).
It is a soft error (PARSE_ERROR
) if the minimal cardinality is not fullfilled. If parsing is optional the parsed data is pushed back into the stream and PARSE_ERROR
is returned, else 0), an exception (std::string) is thrown.
stream | Source from which to read | |
optional | Flag, if node must be found |
YGP::ParseError | In case of a not recoverable error |
Reimplemented from YGP::ParseAttomic.
ParseToText& YGP::ParseToText::operator= | ( | const ParseToText & | other | ) | [inline] |
Assignment operator.