Kodi Documentation 22.0
Kodi is an open source media player and entertainment hub.
Loading...
Searching...
No Matches
CRegExp Class Reference

#include <RegExp.h>

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)
 
 CRegExp (const CRegExp &re)
 
 ~CRegExp ()
 
bool RegComp (const char *re, studyMode study=NoStudy)
 
bool RegComp (const std::string &re, studyMode study=NoStudy)
 
int RegFind (const char *str, unsigned int startoffset=0, int maxNumberOfCharsToTest=-1)
 
int RegFind (const std::string &str, unsigned int startoffset=0, int maxNumberOfCharsToTest=-1)
 
std::string GetReplaceString (const std::string &sReplaceExp) const
 
int GetFindLen () const
 
int GetSubCount () const
 
int GetSubStart (int iSub) const
 
int GetSubLength (int iSub) const
 
int GetCaptureTotal () const
 
std::string GetMatch (int iSub=0) const
 
const std::string & GetPattern () const
 
void DumpOvector (int iLog)
 
bool IsCompiled (void) const
 
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
 

Member Enumeration Documentation

◆ studyMode

Enumerator
NoStudy 
StudyRegExp 
StudyWithJitComp 

◆ utf8Mode

Enumerator
autoUtf8 
asciiOnly 
forceUtf8 

Constructor & Destructor Documentation

◆ CRegExp() [1/3]

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/3]

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

◆ CRegExp() [3/3]

CRegExp::CRegExp ( const CRegExp & re)

◆ ~CRegExp()

CRegExp::~CRegExp ( )

Member Function Documentation

◆ AreUnicodePropertiesSupported()

bool CRegExp::AreUnicodePropertiesSupported ( void )
static

◆ DumpOvector()

void CRegExp::DumpOvector ( int iLog)

◆ GetCaptureTotal()

int CRegExp::GetCaptureTotal ( ) const

◆ GetFindLen()

int CRegExp::GetFindLen ( ) const
inline

◆ GetMatch()

std::string CRegExp::GetMatch ( int iSub = 0) const

◆ GetPattern()

const std::string & CRegExp::GetPattern ( ) const
inline

◆ GetReplaceString()

std::string CRegExp::GetReplaceString ( const std::string & sReplaceExp) const

◆ GetSubCount()

int CRegExp::GetSubCount ( ) const
inline

◆ GetSubLength()

int CRegExp::GetSubLength ( int iSub) const

◆ GetSubStart()

int CRegExp::GetSubStart ( int iSub) const

◆ 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

◆ IsJitSupported()

bool CRegExp::IsJitSupported ( void )
static

◆ IsUtf8Supported()

bool CRegExp::IsUtf8Supported ( void )
static

◆ LogCheckUtf8Support()

bool CRegExp::LogCheckUtf8Support ( void )
static

◆ operator=()

CRegExp & CRegExp::operator= ( const CRegExp & re)

◆ 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

Member Data Documentation

◆ m_MaxNumOfBackrefrences

const int CRegExp::m_MaxNumOfBackrefrences = 20
static

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