TTKMusicPlayer  4.3.0.0
TTKMusicPlayer imitates Kugou UI, the music player uses of qmmp core library based on Qt for windows and linux
Public Types | Public Member Functions | Static Public Member Functions | Private Attributes | List of all members
RegularExpression Class Reference

The class of the regular expression. More...

#include <regularexpression.h>

Public Types

enum  PatternOption { NoPatternOption = 0x0000, CaseInsensitiveOption = 0x0001, InvertedGreedinessOption = 0x0010 }
 

Public Member Functions

 RegularExpression ()
 
 RegularExpression (const QString &pattern, int option=NoPatternOption)
 
QString pattern () const
 
void setPattern (const QString &v)
 
int patternOptions () const
 
void setPatternOptions (const int option)
 
bool hasMatch (const QString &str)
 
int match (const QString &str, int pos=0)
 
QString captured (int index) const
 
int capturedLength () const
 
bool isGreediness () const
 
void setGreediness (bool v)
 
bool isCaseSensitivity () const
 
void setCaseSensitivity (bool v)
 
const QRegularExpression & value () const
 
 operator QRegularExpression & ()
 
 operator const QRegularExpression & () const
 

Static Public Member Functions

static QString escape (const QString &str)
 

Private Attributes

QRegularExpression m_regular
 
QRegularExpressionMatch m_match
 

Detailed Description

The class of the regular expression.

Author
Greedysky greed.nosp@m.ysky.nosp@m.@163..nosp@m.com

Definition at line 32 of file regularexpression.h.

Member Enumeration Documentation

Enumerator
NoPatternOption 
CaseInsensitiveOption 
InvertedGreedinessOption 

Definition at line 35 of file regularexpression.h.

Constructor & Destructor Documentation

RegularExpression::RegularExpression ( )

Object constructor.

RegularExpression::RegularExpression ( const QString &  pattern,
int  option = NoPatternOption 
)
explicit

Member Function Documentation

QString RegularExpression::captured ( int  index) const

Returns the substring captured by the nth capturing group.

int RegularExpression::capturedLength ( ) const

Returns the length of the substring captured by the nth capturing group.

static QString RegularExpression::escape ( const QString &  str)
static

Escapes all characters of string.

bool RegularExpression::hasMatch ( const QString &  str)

Returns true if the regular expression matched against the subject string, or false otherwise.

bool RegularExpression::isCaseSensitivity ( ) const

Returns the case sensitivity option.

bool RegularExpression::isGreediness ( ) const

Returns the greediness option.

int RegularExpression::match ( const QString &  str,
int  pos = 0 
)

Searches the byte array ba, from byte position from (default 0, i.e. from the first byte).

RegularExpression::operator const QRegularExpression & ( ) const
RegularExpression::operator QRegularExpression & ( )
QString RegularExpression::pattern ( ) const

Returns the pattern string of the regular expression.

int RegularExpression::patternOptions ( ) const

Returns the pattern options for the regular expression.

void RegularExpression::setCaseSensitivity ( bool  v)

Set the case sensitivity option.

void RegularExpression::setGreediness ( bool  v)

Set the greediness option.

void RegularExpression::setPattern ( const QString &  v)

Sets the pattern string of the regular expression to pattern.

void RegularExpression::setPatternOptions ( const int  option)

Sets the given options as the pattern options of the regular expression.

const QRegularExpression& RegularExpression::value ( ) const

Member Data Documentation

QRegularExpressionMatch RegularExpression::m_match
private

Definition at line 125 of file regularexpression.h.

QRegularExpression RegularExpression::m_regular
private

Definition at line 124 of file regularexpression.h.


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