edbee - Qt Editor Library
Public Member Functions | List of all members
edbee::QtRegExpEngine Class Reference

The Qt regexp-engine A pretty dumb wrapper around the QRegExp Class. More...

+ Inheritance diagram for edbee::QtRegExpEngine:
+ Collaboration diagram for edbee::QtRegExpEngine:

Public Member Functions

 QtRegExpEngine (const QString &pattern, bool caseSensitive, RegExp::Syntax syntax)
 constructs the QRegExp engine More...
 
virtual ~QtRegExpEngine ()
 destructs the QtRegExpEngine More...
 
virtual QString pattern ()
 Returns the supplied pattern. More...
 
virtual bool isValid ()
 Returns true if the given regular expression was valid. More...
 
virtual QString error ()
 returns the error message More...
 
virtual int indexIn (const QString &str, int offset)
 returns the index of the regexp in the given string More...
 
virtual int indexIn (const QChar *str, int offset, int length)
 Warning index in with char pointers creates a string from the string. More...
 
virtual int lastIndexIn (const QString &str, int offset)
 Returns the last match of this regexp in the given string. More...
 
virtual int lastIndexIn (const QChar *str, int offset, int length)
 Returns the last match of this regexp in the given string. More...
 
virtual int pos (int nth=0) const
 returns the position of the nth group match More...
 
virtual int len (int nth=0) const
 returns the length of the nth group match More...
 
virtual QString cap (int nth=0) const
 returns the nth group More...
 
- Public Member Functions inherited from edbee::RegExpEngine
virtual ~RegExpEngine ()
 

Detailed Description

The Qt regexp-engine A pretty dumb wrapper around the QRegExp Class.

Constructor & Destructor Documentation

◆ QtRegExpEngine()

edbee::QtRegExpEngine::QtRegExpEngine ( const QString &  pattern,
bool  caseSensitive,
RegExp::Syntax  syntax 
)
inline

constructs the QRegExp engine

Parameters
patternthe pattern to match
caseSensitiveis the match case sensitive
syntaxthe used syntadx

◆ ~QtRegExpEngine()

virtual edbee::QtRegExpEngine::~QtRegExpEngine ( )
inlinevirtual

destructs the QtRegExpEngine

Member Function Documentation

◆ cap()

virtual QString edbee::QtRegExpEngine::cap ( int  nth = 0) const
inlinevirtual

returns the nth group

Parameters
nththe group number to return
Returns
the content of the given match

Implements edbee::RegExpEngine.

◆ error()

virtual QString edbee::QtRegExpEngine::error ( )
inlinevirtual

returns the error message

Implements edbee::RegExpEngine.

◆ indexIn() [1/2]

virtual int edbee::QtRegExpEngine::indexIn ( const QString &  str,
int  offset 
)
inlinevirtual

returns the index of the regexp in the given string

Parameters
strthe string to search in
offsetthe start offset of the search
Returns
the index of the given match or < 0 if no match was found

Implements edbee::RegExpEngine.

◆ indexIn() [2/2]

virtual int edbee::QtRegExpEngine::indexIn ( const QChar *  str,
int  offset,
int  length 
)
inlinevirtual

Warning index in with char pointers creates a string from the string.

Parameters
strthe pointer to the given string
offsetthe offset to start searching
lengththe length of the given string
Returns
the index of the given match or < 0 if no match was found

Implements edbee::RegExpEngine.

◆ isValid()

virtual bool edbee::QtRegExpEngine::isValid ( )
inlinevirtual

Returns true if the given regular expression was valid.

Implements edbee::RegExpEngine.

◆ lastIndexIn() [1/2]

virtual int edbee::QtRegExpEngine::lastIndexIn ( const QString &  str,
int  offset 
)
inlinevirtual

Returns the last match of this regexp in the given string.

Parameters
strthe string to search in
offsetthe offset to start searching from
Returns
the matched index or < 0 if not found

Implements edbee::RegExpEngine.

◆ lastIndexIn() [2/2]

virtual int edbee::QtRegExpEngine::lastIndexIn ( const QChar *  str,
int  offset,
int  length 
)
inlinevirtual

Returns the last match of this regexp in the given string.

Parameters
strthe string to search in
offsetthe offset to start searching from
lengththe length of the given string
Returns
the matched index or < 0 if not found

Implements edbee::RegExpEngine.

◆ len()

virtual int edbee::QtRegExpEngine::len ( int  nth = 0) const
inlinevirtual

returns the length of the nth group match

Parameters
nththe group number to return
Returns
the length of the nth match

Implements edbee::RegExpEngine.

◆ pattern()

virtual QString edbee::QtRegExpEngine::pattern ( )
inlinevirtual

Returns the supplied pattern.

Implements edbee::RegExpEngine.

◆ pos()

virtual int edbee::QtRegExpEngine::pos ( int  nth = 0) const
inlinevirtual

returns the position of the nth group match

Parameters
nththe group number to return
Returns
the position of the nth match

Implements edbee::RegExpEngine.


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