xvr2::Text::ExtendedRegex Class Reference

#include <ExtendedRegex.h>

Inheritance diagram for xvr2::Text::ExtendedRegex:

Inheritance graph
[legend]

List of all members.


Detailed Description

Definition at line 26 of file ExtendedRegex.h.


Public Member Functions

 ExtendedRegex ()
 ExtendedRegex (const String &pattern)
const char * pattern (const char *pat=0)
 Returns of specifies the pattern to be used in future Regex::match calls.
void useExtended (bool u=true)
 If called before assigning a pattern the regex compilation will add support for extended regular expressions.
void ignoreCase (bool u=true)
 If called before assigning a pattern the regex compilation will will verify matches disregarding the matchable string case (so it wont matter if it is uppercase or lowercase).
bool matches (const char *str)
 By using the compiled regex it attempts to check if the provided string matches the previously given pattern.
bool matches (const String &str)
 By using the compiled regex it attempts to check if the provided string matches the previously given pattern.
virtual const char * getClassName ()
 Returns the name of the current class.
virtual std::string toString ()

Static Public Member Functions

static bool match (const String &pattern, const String &str, bool case_sensitive=true)
 Verifies that a given string matches a specified paramter.
static void debugmsg (Object *obj, const char *msg, int linenumber=__LINE__, const char *srcfile=__FILE__)
 Will print a debug message to the screen.
static void debugmsgln (Object *obj, const char *msg, int linenumber=__LINE__, const char *srcfile=__FILE__)

Protected Member Functions

virtual void compile ()
 Compiles the provided pattern.

Protected Attributes

int cflags
 Holds the regex compilation flags.
std::string __cls_name

Friends

std::ostream & operator<< (std::ostream &stream, const Object &s)

Constructor & Destructor Documentation

xvr2::Text::ExtendedRegex::ExtendedRegex (  ) 

xvr2::Text::ExtendedRegex::ExtendedRegex ( const String pattern  ) 


Member Function Documentation

virtual void xvr2::Text::ExtendedRegex::compile (  )  [protected, virtual]

Compiles the provided pattern.

This method will make use of the regcomp function call in order to have a regex usable structure. I for some reason the pattern object is null an appropiate exception will be thrown.

Exceptions:
NullPointer if the regex pattern has not been initialized yet
RegexException if regex compilation or matching fails at library level.

Reimplemented from xvr2::Text::Regex.

static bool xvr2::Text::ExtendedRegex::match ( const String pattern,
const String str,
bool  case_sensitive = true 
) [static]

Verifies that a given string matches a specified paramter.

This method makes use of extended regular expressions to achieve its goals.

Parameters:
pattern The regex to be used for verifying matches
str The string to be matched against the pattern
case_sensitive If true then the pattern matching will be case sensitive, if false, then it will be case insensitive.
Returns:
true If the given string matches the patter, false otherwise.

Reimplemented from xvr2::Text::Regex.

const char* xvr2::Text::Regex::pattern ( const char *  pat = 0  )  [inherited]

Returns of specifies the pattern to be used in future Regex::match calls.

If the pattern is provided then it will be compiled automagically, compilation will make use of previous options like useExtended() and ignoreCase().

Parameters:
pat Is the regular expression pattern to be used.
Returns:
The pattern currently in use.
Exceptions:
Exception::NullPointer If the regex pattern has not been initialized yet
Exception::Regex If regex compilation fails

void xvr2::Text::Regex::useExtended ( bool  u = true  )  [inherited]

If called before assigning a pattern the regex compilation will add support for extended regular expressions.

Parameters:
u If true then pattern compilation will use extended regular exprenssions, otherwise common posix regular expressions will be used.

void xvr2::Text::Regex::ignoreCase ( bool  u = true  )  [inherited]

If called before assigning a pattern the regex compilation will will verify matches disregarding the matchable string case (so it wont matter if it is uppercase or lowercase).

Parameters:
u If true then pattern compilation will ignore case, otherwise the matching algorithms will be case sensitive.

bool xvr2::Text::Regex::matches ( const char *  str  )  [inherited]

By using the compiled regex it attempts to check if the provided string matches the previously given pattern.

Parameters:
str The string o test for matches against the given pattern
Returns:
true if it str matches, false if not

bool xvr2::Text::Regex::matches ( const String str  )  [inherited]

By using the compiled regex it attempts to check if the provided string matches the previously given pattern.

Parameters:
str The string o test for matches against the given pattern
Returns:
true if it str matches, false if not

virtual const char* xvr2::Object::getClassName (  )  [virtual, inherited]

Returns the name of the current class.

static void xvr2::Object::debugmsg ( Object obj,
const char *  msg,
int  linenumber = __LINE__,
const char *  srcfile = __FILE__ 
) [static, inherited]

Will print a debug message to the screen.

static void xvr2::Object::debugmsgln ( Object obj,
const char *  msg,
int  linenumber = __LINE__,
const char *  srcfile = __FILE__ 
) [static, inherited]

virtual std::string xvr2::Object::toString (  )  [virtual, inherited]


Friends And Related Function Documentation

std::ostream& operator<< ( std::ostream &  stream,
const Object s 
) [friend, inherited]


Member Data Documentation

int xvr2::Text::Regex::cflags [protected, inherited]

Holds the regex compilation flags.

Definition at line 57 of file Regex.h.

std::string xvr2::Object::__cls_name [protected, inherited]

Definition at line 30 of file Object.h.


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

Generated on Fri Jun 20 22:56:06 2008 for X-VR2 SDK by  doxygen 1.5.5