YGP::ParseQuoted Class Reference

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

Inherits YGP::ParseText.

Inherited by YGP::CBParseQuoted, and YGP::OFParseQuoted< T >.

List of all members.

Public Member Functions

 ParseQuoted (char quote, const char *description, unsigned int max, unsigned int min=1, bool skipWhitespace=true, bool reportData=true)
 ParseQuoted (const ParseQuoted &other)
virtual ~ParseQuoted ()
ParseQuotedoperator= (const ParseQuoted &other)

Static Public Member Functions

static char getClosingChar (char ch)

Protected Member Functions

virtual int checkValue (char ch)


Detailed Description

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

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::ParseQuoted::ParseQuoted ( char  quote,
const char *  description,
unsigned int  max,
unsigned int  min = 1,
bool  skipWhitespace = true,
bool  reportData = true 
)

Constructor; sets the neccessary data of this object.

Parameters:
quote Character limiting the text; the equivalent characters ends parsing.
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
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::ParseQuoted::ParseQuoted ( const ParseQuoted other  ) 

Copy-constructor.

Parameters:
other Object to clone

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

Destructor.


Member Function Documentation

int YGP::ParseQuoted::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::ParseText.

char YGP::ParseQuoted::getClosingChar ( char  ch  )  [static]

Returns the matching "closing" character to the passed one.

This is considered to be:

  • '>' if ch == '<'
  • ')' if ch == '('
  • ']' if ch == '['
  • '}' if ch == '{'
  • '´' if ch == '`'
  • Else: ch
    Parameters:
    ch Char to find match to
    Returns:
    char Character "closing" the passed one

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

Assignment-operator.

Parameters:
other Object to clone
Returns:
ParseQuoted& 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