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

The onig regexp-engine. More...

+ Inheritance diagram for edbee::OnigRegExpEngine:
+ Collaboration diagram for edbee::OnigRegExpEngine:

Public Member Functions

 OnigRegExpEngine (const QString &pattern, bool caseSensitive, RegExp::Syntax syntax)
 Constructs the OnigRegExp engine. More...
 
virtual ~OnigRegExpEngine ()
 destructs the regular expression engine More...
 
virtual QString pattern ()
 returns the pattern used More...
 
virtual bool isValid ()
 returns true if the supplied regular expression was valid More...
 
virtual QString error ()
 returns the error message More...
 
int indexIn (const QChar *charPtr, int offset, int length, bool reverse)
 returns the index of the given QChar array in the given text More...
 
virtual int indexIn (const QString &str, int offset)
 returns the position of the given match or returns an error code More...
 
virtual int indexIn (const QChar *charPtr, int offset, int length)
 returns the position of the given match or returns an error code More...
 
virtual int lastIndexIn (const QString &str, int offset)
 returns the last index of the given string More...
 
virtual int lastIndexIn (const QChar *str, int offset, int length)
 returns the last index of the given string More...
 
virtual int pos (int nth) const
 returns the offset of the given match More...
 
virtual int len (int nth) const
 returns the length of the nth match More...
 
virtual QString cap (int nth=0) const
 returns the capture at the given index More...
 
- Public Member Functions inherited from edbee::RegExpEngine
virtual ~RegExpEngine ()
 

Detailed Description

The onig regexp-engine.

Constructor & Destructor Documentation

◆ OnigRegExpEngine()

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

Constructs the OnigRegExp engine.

Parameters
patternthe regular expression pattern
caseSensitiveis the regexp case senstitive
syntaxthe syntax to use

◆ ~OnigRegExpEngine()

virtual edbee::OnigRegExpEngine::~OnigRegExpEngine ( )
inlinevirtual

destructs the regular expression engine

Member Function Documentation

◆ cap()

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

returns the capture at the given index

Parameters
nththe position of the match
Returns
the match ath the given position

Implements edbee::RegExpEngine.

◆ error()

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

returns the error message

Implements edbee::RegExpEngine.

◆ indexIn() [1/3]

int edbee::OnigRegExpEngine::indexIn ( const QChar *  charPtr,
int  offset,
int  length,
bool  reverse 
)
inline

returns the index of the given QChar array in the given text

Parameters
charPtrthe pointer to the string data
offsetthe offset to start searching
lengththe length of the string data
reverseshould the search be reversed?

◆ indexIn() [2/3]

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

returns the position of the given match or returns an error code

Parameters
strthe string to the search in
offsetthe offset in the string to start the search
Returns
the position of the given match (-1 if not found, -2 on error)

Implements edbee::RegExpEngine.

◆ indexIn() [3/3]

virtual int edbee::OnigRegExpEngine::indexIn ( const QChar *  charPtr,
int  offset,
int  length 
)
inlinevirtual

returns the position of the given match or returns an error code

Parameters
strthe pointer to the line
offsetthe offset to start searching
lengththe total length of the str pointer
Returns
the position of the given match (-1 if not found, -2 on error)

Implements edbee::RegExpEngine.

◆ isValid()

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

returns true if the supplied regular expression was valid

Implements edbee::RegExpEngine.

◆ lastIndexIn() [1/2]

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

returns the last index of the given string

Parameters
strthe string to search in
offsetthe offset of the start of the search
Returns
the index of the match (-1 if not found, -2 on error)

Implements edbee::RegExpEngine.

◆ lastIndexIn() [2/2]

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

returns the last index of the given string

Parameters
strthe string to search in
offsetthe offset of the start of the search
lengththe length of the supplied string data
Returns
the index of the match (-1 if not found, -2 on error)

Implements edbee::RegExpEngine.

◆ len()

virtual int edbee::OnigRegExpEngine::len ( int  nth) const
inlinevirtual

returns the length of the nth match

Parameters
nththe match number

Implements edbee::RegExpEngine.

◆ pattern()

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

returns the pattern used

Implements edbee::RegExpEngine.

◆ pos()

virtual int edbee::OnigRegExpEngine::pos ( int  nth) const
inlinevirtual

returns the offset of the given match

Parameters
nththe given match

Implements edbee::RegExpEngine.


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