YGP::FileRegularExpr Class Reference

Class to compare text with (UNIX-file-style) regular expressions. More...

Inherits YGP::IRegularExpression.

List of all members.

Public Member Functions

 FileRegularExpr (const char *pRegExp)
virtual ~FileRegularExpr ()
virtual int checkIntegrity () const throw (std::invalid_argument)
FileRegularExproperator= (const char *pRegExp)

Protected Member Functions

virtual bool compare (const char *pAktRegExp, const char *pCompare)


Detailed Description

Class to compare text with (UNIX-file-style) regular expressions.

Note:
Depending on the operating system this comparison is either case-sensitive (*X) or just case-preserving (DOS and derivates)!
The following characters have a special meaning:

Note:
To include the character square bracket ([) in the match, it must be the first character; similar to the match-negators caret (^) and exclamaition-mark (!), wich must not be the first character to get included.

The pExpression-parameter is stored as is (and not copied); so take care it is valid during the life-time of the object.

Use IRegularExpression::matches to check if the object matches some data.

Constructor & Destructor Documentation

YGP::FileRegularExpr::FileRegularExpr ( const char *  pRegExp  )  [inline]

Constructor; sets the regular expression to match.

Precondition:
The input is not copied, so it must be valid during the lifetime of the regular expression.

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

Destructor.


Member Function Documentation

int YGP::FileRegularExpr::checkIntegrity (  )  const throw (std::invalid_argument) [virtual]

Checks the syntax of the regular expression.

If everything is OK, 0 is returned; 1 if there is no regular expression at all. In case of any other error an exception is thrown.

Returns:
int Status; 0: OK
Exceptions:
std::invalid_argument In case of an invalid regexp a describing text
Precondition:
pFileRegExp is a valid regexp

Reimplemented from YGP::IRegularExpression.

bool YGP::FileRegularExpr::compare ( const char *  pAktRegExp,
const char *  pCompare 
) [protected, virtual]

Checks if the passed text matches the passed regular expression.

Both passed parameter must not be NULL-pointers and the regular expression must be in a valid syntax (this can be checked with the checkIntegrity()-method).

Parameters:
pAktRegExp Pointer to character array holding regular expression
pCompare Pointer to character array holding value to compare
Returns:
bool Result (true: match)
Precondition:
pAktRegExp, pCompare must be ASCIIZ-strings

Implements YGP::IRegularExpression.

FileRegularExpr& YGP::FileRegularExpr::operator= ( const char *  pRegExp  )  [inline]

Assignmentoperator; specifies the regular expression to match.

Precondition:
The input is not copied, so it must be valid during the lifetime of the regular expression.

Reimplemented from YGP::IRegularExpression.


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