QGIS API Documentation  3.4.15-Madeira (e83d02e274)
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. More...
 
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. More...
 
void readXml (const QDomElement &elem)
 Reads the collection state from an XML element. More...
 
QList< QgsStringReplacementreplacements () const
 Returns the list of string replacements in this collection. More...
 
void setReplacements (const QList< QgsStringReplacement > &replacements)
 Sets the list of string replacements in this collection. More...
 
void writeXml (QDomElement &elem, QDomDocument &doc) const
 Writes the collection state to an XML element. More...
 

Detailed Description

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

Since
QGIS 3.0

Definition at line 112 of file qgsstringutils.h.

Constructor & Destructor Documentation

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

Constructor for QgsStringReplacementCollection.

Parameters
replacementsinitial list of string replacements

Definition at line 121 of file qgsstringutils.h.

Member Function Documentation

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 558 of file qgsstringutils.cpp.

void QgsStringReplacementCollection::readXml ( const QDomElement &  elem)

Reads the collection state from an XML element.

Parameters
elemDOM element
See also
writeXml()

Definition at line 583 of file qgsstringutils.cpp.

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

Returns the list of string replacements in this collection.

See also
setReplacements()

Definition at line 129 of file qgsstringutils.h.

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 137 of file qgsstringutils.h.

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 568 of file qgsstringutils.cpp.


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