xbmc
Public Types | Public Member Functions | Static Public Member Functions | Static Public Attributes | List of all members
CRegExp Class Reference
Collaboration diagram for CRegExp:
Collaboration graph
[legend]

Public Types

enum  studyMode { NoStudy = 0, StudyRegExp = 1, StudyWithJitComp }
 
enum  utf8Mode { autoUtf8 = -1, asciiOnly = 0, forceUtf8 = 1 }
 

Public Member Functions

 CRegExp (bool caseless=false, utf8Mode utf8=asciiOnly)
 
 CRegExp (bool caseless, utf8Mode utf8, const char *re, studyMode study=NoStudy)
 Create new CRegExp object and compile regexp expression in one step. More...
 
 CRegExp (const CRegExp &re)
 
bool RegComp (const char *re, studyMode study=NoStudy)
 Compile (prepare) regular expression. More...
 
bool RegComp (const std::string &re, studyMode study=NoStudy)
 Compile (prepare) regular expression. More...
 
int RegFind (const char *str, unsigned int startoffset=0, int maxNumberOfCharsToTest=-1)
 Find first match of regular expression in given string. More...
 
int RegFind (const std::string &str, unsigned int startoffset=0, int maxNumberOfCharsToTest=-1)
 Find first match of regular expression in given string. More...
 
std::string GetReplaceString (const std::string &sReplaceExp) const
 
int GetFindLen () const
 
int GetSubCount () const
 
int GetSubStart (int iSub) const
 
int GetSubStart (const std::string &subName) const
 
int GetSubLength (int iSub) const
 
int GetSubLength (const std::string &subName) const
 
int GetCaptureTotal () const
 
std::string GetMatch (int iSub=0) const
 
std::string GetMatch (const std::string &subName) const
 
const std::string & GetPattern () const
 
bool GetNamedSubPattern (const char *strName, std::string &strMatch) const
 
int GetNamedSubPatternNumber (const char *strName) const
 
void DumpOvector (int iLog)
 
bool IsCompiled (void) const
 Check is RegExp object is ready for matching. More...
 
CRegExpoperator= (const CRegExp &re)
 

Static Public Member Functions

static bool IsUtf8Supported (void)
 
static bool AreUnicodePropertiesSupported (void)
 
static bool LogCheckUtf8Support (void)
 
static bool IsJitSupported (void)
 

Static Public Attributes

static const int m_MaxNumOfBackrefrences = 20
 

Constructor & Destructor Documentation

◆ CRegExp() [1/2]

CRegExp::CRegExp ( bool  caseless = false,
CRegExp::utf8Mode  utf8 = asciiOnly 
)
Parameters
caseless(optional) Matching will be case insensitive if set to true or case sensitive if set to false
utf8(optional) Control UTF-8 processing

◆ CRegExp() [2/2]

CRegExp::CRegExp ( bool  caseless,
CRegExp::utf8Mode  utf8,
const char *  re,
studyMode  study = NoStudy 
)

Create new CRegExp object and compile regexp expression in one step.

Warning
Use only with hardcoded regexp when you're sure that regexp is compiled without errors
Parameters
caselessMatching will be case insensitive if set to true or case sensitive if set to false
utf8Control UTF-8 processing
reThe regular expression
study(optional) Controls study of expression, useful if expression will be used several times

Member Function Documentation

◆ IsCompiled()

bool CRegExp::IsCompiled ( void  ) const
inline

Check is RegExp object is ready for matching.

Returns
true if RegExp object is ready for matching, false otherwise

◆ RegComp() [1/2]

bool CRegExp::RegComp ( const char *  re,
studyMode  study = NoStudy 
)

Compile (prepare) regular expression.

Parameters
reThe regular expression
study(optional) Controls study of expression, useful if expression will be used several times
Returns
true on success, false on any error

◆ RegComp() [2/2]

bool CRegExp::RegComp ( const std::string &  re,
studyMode  study = NoStudy 
)
inline

Compile (prepare) regular expression.

Parameters
reThe regular expression
study(optional) Controls study of expression, useful if expression will be used several times
Returns
true on success, false on any error

◆ RegFind() [1/2]

int CRegExp::RegFind ( const char *  str,
unsigned int  startoffset = 0,
int  maxNumberOfCharsToTest = -1 
)

Find first match of regular expression in given string.

Parameters
strThe string to match against regular expression
startoffset(optional) The string offset to start matching
maxNumberOfCharsToTest(optional) The maximum number of characters to test (match) in string. If set to -1 string checked up to the end.
Returns
staring position of match in string, negative value in case of error or no match

◆ RegFind() [2/2]

int CRegExp::RegFind ( const std::string &  str,
unsigned int  startoffset = 0,
int  maxNumberOfCharsToTest = -1 
)
inline

Find first match of regular expression in given string.

Parameters
strThe string to match against regular expression
startoffset(optional) The string offset to start matching
maxNumberOfCharsToTest(optional) The maximum number of characters to test (match) in string. If set to -1 string checked up to the end.
Returns
staring position of match in string, negative value in case of error or no match

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