Public Types | Public Member Functions | Private Member Functions | Private Attributes
CtelRegexp Class Reference

List of all members.

Public Types

enum  RStatus {
  GOOD = 0, EXP_TOO_BIG, OUT_OF_MEM, TOO_MANY_PAR,
  UNMATCH_PAR, STARPLUS_EMPTY, STARPLUS_NESTED, INDEX_RANGE,
  INDEX_MATCH, STARPLUS_NOTHING, TRAILING, INT_ERROR,
  BAD_PARAM, BAD_OPCODE
}
 Error codes reported by the engine - Most of these codes never really occurs with this implementation. More...

Public Member Functions

 CtelRegexp (const std::string &pattern)
 Constructor - compile a regular expression.
 ~CtelRegexp ()
 Destructor.
bool compile (const std::string &pattern)
 Compile a new regular expression.
std::string match (const std::string &str)
 matches a particular string; this method returns a string that is a sub-string matching with the regular expression
bool match (const std::string &str, size_t *start, size_t *size)
 another form of matching; returns the indexes of the maching
RStatus getStatus ()
 Get status.
const std::string & getStatusMsg ()
 Get status message.
void clearErrors ()
 Clear all errors.
const std::string & getRe ()
 Return regular expression pattern.
bool split (const std::string &str, std::vector< std::string > &all_matches)
 Split.

Private Member Functions

 CtelRegexp (const CtelRegexp &)
 Private copy constructor.
CtelRegexpoperator= (const CtelRegexp &)
 Private assignment operator.

Private Attributes

std::string strPattern
 STL string to hold pattern.
regexp * r
 Pointer to regexp.
RStatus status
 Return status, enumerated type.
std::string statusMsg
 STL string to hold status message.

Detailed Description

DESCRIPTION: Wrapper for the Regular Expression engine( regexp ) released by Henry Spencer of the University of Toronto.


Member Enumeration Documentation

enum RStatus

Error codes reported by the engine - Most of these codes never really occurs with this implementation.

Enumerator:
GOOD 

Success - no errors.

EXP_TOO_BIG 

Regular expression is too big to be compiled.

OUT_OF_MEM 

out of space( memory )

TOO_MANY_PAR 

too many () parenteses

UNMATCH_PAR 

unmatched () parenteses

STARPLUS_EMPTY 

*+ operand could be empty

STARPLUS_NESTED 

nested *?

INDEX_RANGE 

invalid [] range

INDEX_MATCH 

unmatched []

STARPLUS_NOTHING 

?+* follows nothing

TRAILING 

trailing \"

INT_ERROR 

junk on end, "internal urp", "internal disaster"

BAD_PARAM 

NULL parameter.

BAD_OPCODE 

corrupted opcode


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