YGP::ParseExact Class Reference

Class to parse exactly a certain text (case-sensitive!). More...

Inherits YGP::ParseAttomic.

Inherited by YGP::CBParseExact, YGP::OFParseExact< T >, and YGP::ParseUpperExact.

List of all members.

Public Types

enum  { POS_ERROR = ParseAttomic::LAST, LAST }

Public Member Functions

 ParseExact (const char *value, const char *description, bool skipWhitespace=true, bool reportData=true)
 ParseExact (const char *value, const char *description, unsigned int max, unsigned int min, bool skipWhitespace=true, bool reportData=true)
 ParseExact (const ParseExact &other)
virtual ~ParseExact ()
ParseExactoperator= (const ParseExact &other)

Protected Member Functions

virtual int checkIntegrity () const
virtual int checkValue (char ch)


Detailed Description

Class to parse exactly a certain text (case-sensitive!).

The min- and max-members are not totally wasted; they could be used to define the minimal length of certain keywords which would be valid even if just written in a short(er) form and/or to include values with a zero ('\0') character (although the main reason for them is that I didn't want to re-consider the class-hierarchy anymore).

Note:
This class uses strlen to get the length of its value so don't use its first constructor to check for text with a '\0' inside!
See ParseObject for a general description of the parser.

Constructor & Destructor Documentation

YGP::ParseExact::ParseExact ( const char *  value,
const char *  description,
bool  skipWhitespace = true,
bool  reportData = true 
)

Constructor.

Constructor; sets the neccessary data of this object.

Parameters:
value Sequence of characters to parse in that order
description Description of the object (what it parses)
skipWhitespace Flag if trailing whitespaces should be skipped after sucessfully parsing the object
reportData Flag, if data should be stored and reported
Precondition:
value != NULL && !ParseObjectcheckIntegrity ()

YGP::ParseExact::ParseExact ( const char *  value,
const char *  description,
unsigned int  max,
unsigned int  min,
bool  skipWhitespace = true,
bool  reportData = true 
) [inline]

Constructor with explicit length of the object to parse.

YGP::ParseExact::ParseExact ( const ParseExact other  )  [inline]

Copy constructor.

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

Destructor.


Member Function Documentation

int YGP::ParseExact::checkIntegrity (  )  const [protected, virtual]

Checks the constraints of the object.

Returns:
int Status; 0 OK

Reimplemented from YGP::ParseAttomic.

Reimplemented in YGP::ParseUpperExact.

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

Checks if the passed character is exactly equal (case-sensitive!) than the one in the actual position of the object.

Parameters:
ch Char to check
Returns:
int Result; true if valid

Reimplemented from YGP::ParseAttomic.

Reimplemented in YGP::ParseUpperExact.

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

Assignment-operator.

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