YGP::ParseToText Class Reference

Class to parse text until the specified text is found. More...

Inherits YGP::ParseAttomic.

Inherited by YGP::CBParseToText, and YGP::OFParseToText< T >.

List of all members.

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 ()
ParseToTextoperator= (const ParseToText &other)
virtual int doParse (Xistream &stream, bool optional) throw (YGP::ParseError)


Detailed Description

Class to parse text until the specified text is found.

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.


Constructor & Destructor Documentation

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.


Member Function Documentation

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.

Parameters:
stream Source from which to read
optional Flag, if node must be found
Exceptions:
YGP::ParseError In case of a not recoverable error

Reimplemented from YGP::ParseAttomic.

ParseToText& YGP::ParseToText::operator= ( const ParseToText other  )  [inline]

Assignment operator.


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

YGP Version 0.9.31 - Generated on Wed Nov 18 11:25:27 2009 by doxygen 1.5.8