QGIS API Documentation 3.41.0-Master (45a0abf3bec)
|
A representation of a single string replacement. More...
#include <qgsstringutils.h>
Public Member Functions | |
QgsStringReplacement (const QString &match, const QString &replacement, bool caseSensitive=false, bool wholeWordOnly=false) | |
Constructor for QgsStringReplacement. | |
bool | caseSensitive () const |
Returns true if match is case sensitive. | |
QString | match () const |
Returns the string matched by this object. | |
bool | operator== (const QgsStringReplacement &other) const |
QString | process (const QString &input) const |
Processes a given input string, applying any valid replacements which should be made. | |
QgsStringMap | properties () const |
Returns a map of the replacement properties. | |
QString | replacement () const |
Returns the string to replace matches with. | |
bool | wholeWordOnly () const |
Returns true if match only applies to whole words, or false if partial word matches are permitted. | |
Static Public Member Functions | |
static QgsStringReplacement | fromProperties (const QgsStringMap &properties) |
Creates a new QgsStringReplacement from an encoded properties map. | |
A representation of a single string replacement.
Definition at line 37 of file qgsstringutils.h.
QgsStringReplacement::QgsStringReplacement | ( | const QString & | match, |
const QString & | replacement, | ||
bool | caseSensitive = false , |
||
bool | wholeWordOnly = false |
||
) |
Constructor for QgsStringReplacement.
match | string to match |
replacement | string to replace match with |
caseSensitive | set to true for a case sensitive match |
wholeWordOnly | set to true to match complete words only, or false to allow partial word matches |
Definition at line 748 of file qgsstringutils.cpp.
|
inline |
Returns true
if match is case sensitive.
Definition at line 61 of file qgsstringutils.h.
|
static |
Creates a new QgsStringReplacement from an encoded properties map.
Definition at line 784 of file qgsstringutils.cpp.
|
inline |
Returns the string matched by this object.
Definition at line 55 of file qgsstringutils.h.
|
inline |
Definition at line 73 of file qgsstringutils.h.
QString QgsStringReplacement::process | ( | const QString & | input | ) | const |
Processes a given input string, applying any valid replacements which should be made.
input | input string |
Definition at line 761 of file qgsstringutils.cpp.
QgsStringMap QgsStringReplacement::properties | ( | ) | const |
Returns a map of the replacement properties.
Definition at line 774 of file qgsstringutils.cpp.
|
inline |
Returns the string to replace matches with.
Definition at line 58 of file qgsstringutils.h.
|
inline |
Returns true
if match only applies to whole words, or false
if partial word matches are permitted.
Definition at line 64 of file qgsstringutils.h.