QGIS API Documentation 3.41.0-Master (af5edcb665c)
Loading...
Searching...
No Matches
Public Member Functions | Static Public Member Functions | List of all members
QgsStringReplacement Class Reference

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.
 

Detailed Description

A representation of a single string replacement.

Definition at line 37 of file qgsstringutils.h.

Constructor & Destructor Documentation

◆ QgsStringReplacement()

QgsStringReplacement::QgsStringReplacement ( const QString &  match,
const QString &  replacement,
bool  caseSensitive = false,
bool  wholeWordOnly = false 
)

Constructor for QgsStringReplacement.

Parameters
matchstring to match
replacementstring to replace match with
caseSensitiveset to true for a case sensitive match
wholeWordOnlyset to true to match complete words only, or false to allow partial word matches

Definition at line 765 of file qgsstringutils.cpp.

Member Function Documentation

◆ caseSensitive()

bool QgsStringReplacement::caseSensitive ( ) const
inline

Returns true if match is case sensitive.

Definition at line 61 of file qgsstringutils.h.

◆ fromProperties()

QgsStringReplacement QgsStringReplacement::fromProperties ( const QgsStringMap properties)
static

Creates a new QgsStringReplacement from an encoded properties map.

See also
properties()

Definition at line 801 of file qgsstringutils.cpp.

◆ match()

QString QgsStringReplacement::match ( ) const
inline

Returns the string matched by this object.

Definition at line 55 of file qgsstringutils.h.

◆ operator==()

bool QgsStringReplacement::operator== ( const QgsStringReplacement other) const
inline

Definition at line 73 of file qgsstringutils.h.

◆ process()

QString QgsStringReplacement::process ( const QString &  input) const

Processes a given input string, applying any valid replacements which should be made.

Parameters
inputinput string
Returns
input string with any matches replaced by replacement string

Definition at line 778 of file qgsstringutils.cpp.

◆ properties()

QgsStringMap QgsStringReplacement::properties ( ) const

Returns a map of the replacement properties.

See also
fromProperties()

Definition at line 791 of file qgsstringutils.cpp.

◆ replacement()

QString QgsStringReplacement::replacement ( ) const
inline

Returns the string to replace matches with.

Definition at line 58 of file qgsstringutils.h.

◆ wholeWordOnly()

bool QgsStringReplacement::wholeWordOnly ( ) const
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.


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