artefaktur
software engineer &        architecture

 
 
 
 

class RegExp

Modules   Namespace List   Class Hierarchy   Alphabetical List   Compound List   Namespace Members   Compound Members   Related Pages  

acdk::text::RegExp Class Reference

#include <RegExp.h>

Inheritance diagram for acdk::text::RegExp:

acdk::lang::Object acdk::lang::ObjectBase acdk::lang::dmi::StdDispatch List of all members.

Detailed Description

Implements Regular Expression API: ACDK

Author:
Roger Rene Kommer
Version:
Revision
1.17
Date:
Date
2005/04/08 10:53:21


Public Member Functions

 RegExp (IN(RString) expression, int cflags=0)
 ~RegExp ()
virtual bool test (IN(RString) str, int eflags=0)
 Tests if the pattern matches at given str .

int matchSize (IN(RString) text, int eflags=0)
int match (IN(RString) text, int *slots, int slotnum, int eflags=0)
 returns the matching substring in slots

virtual RStringArray match (IN(RString) str, int eflags=0)
virtual RRegExpMatchPositionArray matchPos (IN(RString) str, int eflags=0)
RString replace (IN(RString) text, IN(RString) with, bool replaceAll)

Static Public Member Functions

RString escape (IN(RString) str)
 Escapes all meta charakters.


Protected Member Functions

int _match (const char *it, const char *end, int *slots, int slotnum, int eflags=0)
 returns the matching substring in slots

int _matchSize (const char *it, const char *end, int eflags=0)

Private Attributes

int _errorCode
 stores the POSIX-error Code

pcre_pcre
 from posix

pcre_extra_pcre_extra

Constructor & Destructor Documentation

acdk::text::RegExp::RegExp IN(RString expression,
int  cflags = 0
 

Parameters:
expression the regular expression
cflags a combination of RegExpCompileFlags

acdk::text::RegExp::~RegExp  ) 
 


Member Function Documentation

int acdk::text::RegExp::_match const char *  it,
const char *  end,
int *  slots,
int  slotnum,
int  eflags = 0
[protected]
 

returns the matching substring in slots

Returns:
-1 if not matching, otherwise count of filled slots return ajustes Character offset (not byte-offset of the UTF8-Stream

int acdk::text::RegExp::_matchSize const char *  it,
const char *  end,
int  eflags = 0
[protected]
 

RString acdk::text::RegExp::escape IN(RString str  )  [static]
 

Escapes all meta charakters.

virtual RStringArray acdk::text::RegExp::match IN(RString str,
int  eflags = 0
[virtual]
 

Parameters:
eflags any combinations of RegExpEvaluateFlags
Returns:
an StringArray: [0] substring matched [1 - n] safed expression with '()'

int acdk::text::RegExp::match IN(RString text,
int *  slots,
int  slotnum,
int  eflags = 0
 

returns the matching substring in slots

Parameters:
text text to match
slots array of ints. slot[0] until slot[1]: match of regular expression slot[n] until slot[n + 1]: matches n'th subexpression
slotnum size of array slots
Returns:
-1 if not matching

virtual RRegExpMatchPositionArray acdk::text::RegExp::matchPos IN(RString str,
int  eflags = 0
[virtual]
 

Parameters:
eflags any combinations of RegExpEvaluateFlags
Returns:
an RegExpMatchPosition: [0] substring matched [1 - n] safed expression with '()'

int acdk::text::RegExp::matchSize IN(RString text,
int  eflags = 0
 

RString acdk::text::RegExp::replace IN(RString text,
IN(RString with,
bool  replaceAll
 

virtual bool acdk::text::RegExp::test IN(RString str,
int  eflags = 0
[virtual]
 

Tests if the pattern matches at given str .

Parameters:
eflags any combinations of RegExpEvaluateFlags
Returns:
true if matches

Member Data Documentation

int acdk::text::RegExp::_errorCode [private]
 

stores the POSIX-error Code

pcre* acdk::text::RegExp::_pcre [private]
 

from posix

pcre_extra* acdk::text::RegExp::_pcre_extra [private]
 

 
Last modified 2005-05-08 18:33 by SYSTEM By Artefaktur, Ing. Bureau Kommer