All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
HSEP::RegexpChecker Class Reference

Provides a basic "extended POSIX" regular expression match engine. More...

#include <RegexpChecker.h>

+ Inheritance diagram for HSEP::RegexpChecker:
+ Collaboration diagram for HSEP::RegexpChecker:

Public Member Functions

 RegexpChecker (StringDictionary &pDefinitionsRef)
 Creates the match engine, receiving a string dictionary whose key is the name of every possible extended POSIX regular expression, and the value is the regular expression by itself.
 
bool match (const char *pType, string pDataStr)
 Indicates if the given string.
 
string & key (const char *pSample)
 When the given value match the regular expression, returns the corresponding key.
 
- Public Member Functions inherited from HSEP::HSEPObject
string & lastErrorRef ()
 Returns a reference to the last stored error message.
 
ErrorCode lastCode ()
 Returns the last stored code.
 
bool valid ()
 Permits to know if the object has a valid internal state.
 
string & typeRef ()
 Permits to know the type of this particular object.
 

Static Public Attributes

static string NOTFOUND = "NOT FOUND"
 

Additional Inherited Members

- Protected Member Functions inherited from HSEP::HSEPObject
 HSEPObject (const char *pType)
 Constructor, providing the base for the state controlling instance.
 
virtual ~HSEPObject ()
 
void setLastError (string &pErrorMsgRef)
 Assigns an error message text to the last executed operation.
 
void setLastError (const string &pErrorMsgRef)
 Assigns an error message text to the last executed operation.
 
void setLastError (const char *pErrorMsg)
 Assigns an error message text to the last executed operation.
 
void setValid ()
 Defines that the object has a valid state.
 
void setInvalid ()
 Defines that the object has an invalid state.
 
void setLastCode (const ErrorCode pErrorCode)
 Defines the internal result code for the object.
 

Detailed Description

Provides a basic "extended POSIX" regular expression match engine.

Definition at line 39 of file RegexpChecker.h.

Constructor & Destructor Documentation

HSEP::RegexpChecker::RegexpChecker ( StringDictionary pDefinitionsRef)

Creates the match engine, receiving a string dictionary whose key is the name of every possible extended POSIX regular expression, and the value is the regular expression by itself.

A possible way to "feed" the RegexpChecker is loading the string dictionary from a file using a FileTool instance.

Parameters
pDefinitionsRefreference to the regexp definitions.

Definition at line 28 of file RegexpChecker.cpp.

References HSEP::Dictionary< T >::forEach(), HSEP::Dictionary< T >::put(), and HSEP::HSEPObject::valid().

+ Here is the call graph for this function:

Member Function Documentation

string & HSEP::RegexpChecker::key ( const char *  pSample)

When the given value match the regular expression, returns the corresponding key.

When the regex set has a DEFAULT as value, and no corresponding match exist, returns that DEFAULT instead of TypeChecker::NOTFOUND; if no DEFAULT is found, returns the TypeChecker::NOTFOUND value.

Parameters
pSample
Returns
corresponding key when the pSample matches a stored regexp
TypeChecker::NOTFOUND when there is no match and not default

Definition at line 57 of file RegexpChecker.cpp.

References HSEP::Dictionary< T >::forEach(), HSEP::Regexp::match(), NOTFOUND, and HSEP::Regexp::text().

+ Here is the call graph for this function:

bool HSEP::RegexpChecker::match ( const char *  pType,
string  pDataStr 
)

Indicates if the given string.

Parameters
pType
pDataStr
Returns

Definition at line 47 of file RegexpChecker.cpp.

References HSEP::Dictionary< T >::has(), HSEP::Regexp::match(), and HSEP::Dictionary< T >::ref().

+ Here is the call graph for this function:

Member Data Documentation

string HSEP::RegexpChecker::NOTFOUND = "NOT FOUND"
static

Definition at line 45 of file RegexpChecker.h.

Referenced by key().


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