Qx v0.5.8
Qt Extensions Library
|
The TextQuery class contains rules for conducting a search of text. More...
#include <qx/io/qx-textquery.h>
Public Member Functions | |
TextQuery (const QString &string, Qt::CaseSensitivity cs=Qt::CaseSensitive) | |
bool | allowSplit () const |
Qt::CaseSensitivity | caseSensitivity () const |
int | hitLimit () const |
int | hitsToSkip () const |
void | setAllowSplit (bool allowSplit) |
void | setCaseSensitivity (Qt::CaseSensitivity caseSensitivity) |
void | setHitLimit (int hitLimit) |
void | setHitsToSkip (int hitsToSkip) |
void | setStartPosition (TextPos startPosition) |
void | setString (QString string) |
TextPos | startPosition () const |
const QString & | string () const |
Qx::TextQuery::TextQuery | ( | const QString & | string, |
Qt::CaseSensitivity | cs = Qt::CaseSensitive ) |
Creates a text query with the target string, abiding by cs case sensitivity.
bool Qx::TextQuery::allowSplit | ( | ) | const |
Returns whether or not the target string will be matched if it falls across one or more line breaks.
The default is false
.
Qt::CaseSensitivity Qx::TextQuery::caseSensitivity | ( | ) | const |
Returns the case sensitivity of the query.
int Qx::TextQuery::hitLimit | ( | ) | const |
Returns the number of matches to make before stopping the search.
The default is -1 (unlimited).
int Qx::TextQuery::hitsToSkip | ( | ) | const |
Returns the number of times to skip the query string before a true match is made.
The default is 0.
void Qx::TextQuery::setAllowSplit | ( | bool | allowSplit | ) |
Sets whether or not the target string will be matched if it falls across one or more line breaks.
void Qx::TextQuery::setCaseSensitivity | ( | Qt::CaseSensitivity | caseSensitivity | ) |
Sets the case sensitivity of the query.
void Qx::TextQuery::setHitLimit | ( | int | hitLimit | ) |
Sets the the number of matches to make before stopping the search.
Use -1 for no limit.
void Qx::TextQuery::setHitsToSkip | ( | int | hitsToSkip | ) |
Sets the number of times to skip the query string before a true match is made.
void Qx::TextQuery::setStartPosition | ( | TextPos | startPosition | ) |
Sets the position from which the search should begin.
void Qx::TextQuery::setString | ( | QString | string | ) |
Sets the query's target string.
TextPos Qx::TextQuery::startPosition | ( | ) | const |
Returns the position from which the search should begin.
The default is TextPos(Start)
.
const QString & Qx::TextQuery::string | ( | ) | const |
Returns the query's target string.