QGIS API Documentation  2.18.3-Las Palmas (77b8c3d)
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).

Note
Added in version 3.0

Definition at line 105 of file qgsstringutils.h.

Constructor & Destructor Documentation

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

Constructor for QgsStringReplacementCollection.

Parameters
replacementsinitial list of string replacements

Definition at line 113 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 432 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 457 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 120 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 127 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 442 of file qgsstringutils.cpp.


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