|
TTKMusicPlayer
4.3.0.0
TTKMusicPlayer imitates Kugou UI, the music player uses of qmmp core library based on Qt for windows and linux
|
The class of the regular expression. More...
#include <ttkregularexpression.h>
Public Types | |
| enum | PatternOption { NoPatternOption = 0x0000, CaseInsensitiveOption = 0x0001, InvertedGreedinessOption = 0x0010 } |
Public Member Functions | |
| TTKRegularExpression () | |
| TTKRegularExpression (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 QRegExp & | value () const |
| operator QRegExp & () | |
| operator const QRegExp & () const | |
Static Public Member Functions | |
| static QString | escape (const QString &str) |
Private Attributes | |
| QRegExp | m_regular |
The class of the regular expression.
Definition at line 32 of file ttkregularexpression.h.
| Enumerator | |
|---|---|
| NoPatternOption | |
| CaseInsensitiveOption | |
| InvertedGreedinessOption | |
Definition at line 35 of file ttkregularexpression.h.
| TTKRegularExpression::TTKRegularExpression | ( | ) |
Object constructor.
Definition at line 3 of file ttkregularexpression.cpp.
|
explicit |
Definition at line 12 of file ttkregularexpression.cpp.
| QString TTKRegularExpression::captured | ( | int | index | ) | const |
Returns the substring captured by the nth capturing group.
Definition at line 79 of file ttkregularexpression.cpp.
References m_regular.
Referenced by MusicLrcFromQrc::decode(), MusicLrcFromYrc::decode(), MusicWYTranslationRequest::downloadFinished(), generateDPIValue(), TTK::File::getSaveFileName(), QDlnaFileServer::handleRequest(), MusicLrcAnalysis::matchLrcLine(), ReqKGInterface::parseFromMovieInfo(), ReqKWInterface::parseFromMovieProperty(), parseSongPropertyV2(), MusicM3UConfigManager::readBuffer(), MusicPLSConfigManager::readBuffer(), MusicAdvancedSearchedWidget::searchedKeyWork(), MusicBingTranslationRequest::startToRequest(), MusicYDTranslationRequest::startToRequest(), and TTKPlatformSystem::systemName().
| int TTKRegularExpression::capturedLength | ( | ) | const |
Returns the length of the substring captured by the nth capturing group.
Definition at line 88 of file ttkregularexpression.cpp.
References m_regular.
Referenced by MusicLrcAnalysis::matchLrcLine().
|
static |
Escapes all characters of string.
Definition at line 137 of file ttkregularexpression.cpp.
| bool TTKRegularExpression::hasMatch | ( | const QString & | str | ) |
Returns true if the regular expression matched against the subject string, or false otherwise.
Definition at line 59 of file ttkregularexpression.cpp.
References m_regular.
| bool TTKRegularExpression::isCaseSensitivity | ( | ) | const |
Returns the case sensitivity option.
Definition at line 117 of file ttkregularexpression.cpp.
References m_regular.
Referenced by patternOptions().
| bool TTKRegularExpression::isGreediness | ( | ) | const |
Returns the greediness option.
Definition at line 97 of file ttkregularexpression.cpp.
References m_regular.
Referenced by patternOptions().
Searches the byte array ba, from byte position from (default 0, i.e. from the first byte).
Definition at line 69 of file ttkregularexpression.cpp.
References m_regular.
Referenced by MusicLrcFromQrc::decode(), MusicLrcFromYrc::decode(), MusicWYTranslationRequest::downloadFinished(), generateDPIValue(), TTK::File::getSaveFileName(), QDlnaFileServer::handleRequest(), MusicLrcAnalysis::matchLrcLine(), ReqKGInterface::parseFromMovieInfo(), ReqKWInterface::parseFromMovieProperty(), parseSongPropertyV2(), MusicM3UConfigManager::readBuffer(), MusicPLSConfigManager::readBuffer(), MusicAdvancedSearchedWidget::searchedKeyWork(), MusicBingTranslationRequest::startToRequest(), MusicYDTranslationRequest::startToRequest(), and TTKPlatformSystem::systemName().
| TTKRegularExpression::operator const QRegExp & | ( | ) | const |
Definition at line 167 of file ttkregularexpression.cpp.
| TTKRegularExpression::operator QRegExp & | ( | ) |
Definition at line 158 of file ttkregularexpression.cpp.
| QString TTKRegularExpression::pattern | ( | ) | const |
Returns the pattern string of the regular expression.
Definition at line 21 of file ttkregularexpression.cpp.
References m_regular.
| int TTKRegularExpression::patternOptions | ( | ) | const |
Returns the pattern options for the regular expression.
Definition at line 31 of file ttkregularexpression.cpp.
References isCaseSensitivity(), and isGreediness().
| void TTKRegularExpression::setCaseSensitivity | ( | bool | v | ) |
Set the case sensitivity option.
Definition at line 127 of file ttkregularexpression.cpp.
References m_regular.
Referenced by setPatternOptions(), and MusicBingTranslationRequest::startToRequest().
| void TTKRegularExpression::setGreediness | ( | bool | v | ) |
Set the greediness option.
Definition at line 107 of file ttkregularexpression.cpp.
References m_regular.
Referenced by setPatternOptions().
| void TTKRegularExpression::setPattern | ( | const QString & | v | ) |
Sets the pattern string of the regular expression to pattern.
Definition at line 26 of file ttkregularexpression.cpp.
References m_regular.
Referenced by MusicLrcAnalysis::matchLrcLine(), and MusicAdvancedSearchedWidget::searchedKeyWork().
Sets the given options as the pattern options of the regular expression.
Definition at line 46 of file ttkregularexpression.cpp.
References setCaseSensitivity(), and setGreediness().
| const QRegExp & TTKRegularExpression::value | ( | ) | const |
Definition at line 149 of file ttkregularexpression.cpp.
|
private |
Definition at line 126 of file ttkregularexpression.h.
Referenced by captured(), capturedLength(), hasMatch(), isCaseSensitivity(), isGreediness(), match(), pattern(), setCaseSensitivity(), setGreediness(), and setPattern().
1.8.8