QGIS API Documentation 3.41.0-Master (3440c17df1d)
Loading...
Searching...
No Matches
Public Member Functions | List of all members
QgsStringReplacementCollection Class Reference

A collection of string replacements (specified using QgsStringReplacement objects). More...

#include <qgsstringutils.h>

Public Member Functions

 QgsStringReplacementCollection (const QList< QgsStringReplacement > &replacements=QList< QgsStringReplacement >())
 Constructor for QgsStringReplacementCollection.
 
QString process (const QString &input) const
 Processes a given input string, applying any valid replacements which should be made using QgsStringReplacement objects contained by this collection.
 
void readXml (const QDomElement &elem)
 Reads the collection state from an XML element.
 
QList< QgsStringReplacementreplacements () const
 Returns the list of string replacements in this collection.
 
void setReplacements (const QList< QgsStringReplacement > &replacements)
 Sets the list of string replacements in this collection.
 
void writeXml (QDomElement &elem, QDomDocument &doc) const
 Writes the collection state to an XML element.
 

Detailed Description

A collection of string replacements (specified using QgsStringReplacement objects).

Definition at line 113 of file qgsstringutils.h.

Constructor & Destructor Documentation

◆ QgsStringReplacementCollection()

QgsStringReplacementCollection::QgsStringReplacementCollection ( const QList< QgsStringReplacement > &  replacements = QList< QgsStringReplacement >())
inline

Constructor for QgsStringReplacementCollection.

Parameters
replacementsinitial list of string replacements

Definition at line 122 of file qgsstringutils.h.

Member Function Documentation

◆ process()

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

Processes a given input string, applying any valid replacements which should be made using QgsStringReplacement objects contained by this collection.

Replacements are made in order of the QgsStringReplacement objects contained in the collection.

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

Definition at line 792 of file qgsstringutils.cpp.

◆ readXml()

void QgsStringReplacementCollection::readXml ( const QDomElement &  elem)

Reads the collection state from an XML element.

Parameters
elemDOM element
See also
writeXml()

Definition at line 817 of file qgsstringutils.cpp.

◆ replacements()

QList< QgsStringReplacement > QgsStringReplacementCollection::replacements ( ) const
inline

Returns the list of string replacements in this collection.

See also
setReplacements()

Definition at line 130 of file qgsstringutils.h.

◆ setReplacements()

void QgsStringReplacementCollection::setReplacements ( const QList< QgsStringReplacement > &  replacements)
inline

Sets the list of string replacements in this collection.

Parameters
replacementslist of string replacements to apply. Replacements are applied in the order they are specified here.
See also
replacements()

Definition at line 138 of file qgsstringutils.h.

◆ writeXml()

void QgsStringReplacementCollection::writeXml ( QDomElement &  elem,
QDomDocument &  doc 
) const

Writes the collection state to an XML element.

Parameters
elemtarget DOM element
docDOM document
See also
readXml()

Definition at line 802 of file qgsstringutils.cpp.


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