YGP::ParseQuotedEsc Class Reference

Class to parse a quoted text-value until a specified abort-character is found. More...

Inherits YGP::ParseTextEsc.

Inherited by YGP::CBParseQuotedEsc, and YGP::OFParseQuotedEsc< T >.

List of all members.

Public Member Functions

 ParseQuotedEsc (char quote, const char *description, unsigned int max, unsigned int min=1, char escape= '\\', bool skipWhitespace=true, bool reportData=true)
 ParseQuotedEsc (const ParseQuotedEsc &other)
virtual ~ParseQuotedEsc ()
ParseQuotedEscoperator= (const ParseQuotedEsc &other)

Protected Member Functions

virtual int checkValue (char ch)


Detailed Description

Class to parse a quoted text-value until a specified abort-character is found.

However, parsing is continued if those characters are preceeded by a escape-character (which "escapes" the special meaning of that character).

Parsing of this element is stopped, if the closing quote is found (or the maximal cardinality is reached). Note that this closing character is not necessarily the same as the opening one. The following characters have different closing characters (for all others opening and closing quote are the same):

See ParseObject for a general description of the parser.


Constructor & Destructor Documentation

YGP::ParseQuotedEsc::ParseQuotedEsc ( char  quote,
const char *  description,
unsigned int  max,
unsigned int  min = 1,
char  escape = '\\',
bool  skipWhitespace = true,
bool  reportData = true 
)

Constructor; sets the neccessary data of this object.

Parameters:
quote Character limiting the text
description Description of the object (what it parses)
max Maximal cardinality, how often can the object be parsed
min Minimal cardinality, how often must the object be parsed
escape Character which escapes characters in value
skipWhitespace Flag if trailing whitespaces should be skipped after sucessfully parsing the object
reportData Flag if parsed data should be stored and reported via the virtual found method
Precondition:
!checkIntegrity ()

YGP::ParseQuotedEsc::ParseQuotedEsc ( const ParseQuotedEsc other  ) 

Copy-constructor.

Parameters:
other Object to clone

YGP::ParseQuotedEsc::~ParseQuotedEsc (  )  [virtual]

Destructor.


Member Function Documentation

int YGP::ParseQuotedEsc::checkValue ( char  ch  )  [protected, virtual]

Checks if the parsed value is according the quote.

The quotes themself are also valid, though not included in the output. Valid are every characters NOT in pValue.

Parameters:
ch Char to check
Returns:
int: Result; true if ch is an ordinary character, -1 if it is quote, 0 after ending quote

Reimplemented from YGP::ParseTextEsc.

ParseQuotedEsc & YGP::ParseQuotedEsc::operator= ( const ParseQuotedEsc other  ) 

Assignment-operator.

Parameters:
other Object to clone
Returns:
ParseQuotedEsc& Reference to this


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