19 #include <QDomDocument> 23 #ifndef QGSSTRINGUTILS_H 24 #define QGSSTRINGUTILS_H 46 bool caseSensitive =
false,
47 bool wholeWordOnly =
false );
69 return mMatch == other.mMatch
70 && mReplacement == other.mReplacement
71 && mCaseSensitive == other.mCaseSensitive
72 && mWholeWordOnly == other.mWholeWordOnly;
114 : mReplacements( replacements )
129 mReplacements = replacements;
173 MixedCase = QFont::MixedCase,
174 AllUppercase = QFont::AllUppercase,
175 AllLowercase = QFont::AllLowercase,
176 ForceFirstLetterToCapital = QFont::Capitalize,
195 static int levenshteinDistance(
const QString &string1,
const QString &string2,
bool caseSensitive =
false );
205 static QString longestCommonSubstring(
const QString &string1,
const QString &string2,
bool caseSensitive =
false );
215 static int hammingDistance(
const QString &string1,
const QString &string2,
bool caseSensitive =
false );
231 static QString insertLinks(
const QString&
string,
bool* foundLinks =
nullptr );
234 #endif //QGSSTRINGUTILS_H bool operator==(const QgsStringReplacement &other)
A representation of a single string replacement.
bool caseSensitive() const
Returns true if match is case sensitive.
QgsStringReplacementCollection(const QList< QgsStringReplacement > &replacements=QList< QgsStringReplacement >())
Constructor for QgsStringReplacementCollection.
QList< QgsStringReplacement > replacements() const
Returns the list of string replacements in this collection.
QString match() const
Returns the string matched by this object.
QString replacement() const
Returns the string to replace matches with.
Capitalization
Capitalization options.
bool wholeWordOnly() const
Returns true if match only applies to whole words, or false if partial word matches are permitted...
A collection of string replacements (specified using QgsStringReplacement objects).
Utility functions for working with strings.
void setReplacements(const QList< QgsStringReplacement > &replacements)
Sets the list of string replacements in this collection.