KItinerary::StringUtil Namespace Reference


QStringView betterString (QStringView lhs, QStringView rhs)
QString clean (const QString &s)
QString normalize (QStringView str)
float prefixSimilarity (QStringView s1, QStringView s2)
QString transliterate (QStringView s)

Detailed Description

String normalization and comparison utilities.

Function Documentation

◆ betterString()

QStringView KItinerary::StringUtil::betterString ( QStringView  lhs,
QStringView  rhs 

Assuming both sides are describing the same thing, this tries to find the "better" string.

That is, prefer the one that didn't lose casing/unicode/etc in previous processing.

Definition at line 76 of file stringutil.cpp.

◆ clean()

QString KItinerary::StringUtil::clean ( const QString s)

Cleans up extra white spaces and XML entities from s.

Definition at line 151 of file stringutil.cpp.

◆ normalize()

QString KItinerary::StringUtil::normalize ( QStringView  str)

Strips out diacritics and converts to case-folded form.

Definition at line 16 of file stringutil.cpp.

◆ prefixSimilarity()

float KItinerary::StringUtil::prefixSimilarity ( QStringView  s1,
QStringView  s2 

Returns how much of the prefix of two given strings are equal, in relation to the longer of the two input strings.

Definition at line 131 of file stringutil.cpp.

◆ transliterate()

QString KItinerary::StringUtil::transliterate ( QStringView  s)

Transliterate diacritics or other special characters.

Definition at line 168 of file stringutil.cpp.

This file is part of the KDE documentation.
Documentation copyright © 1996-2023 The KDE developers.
Generated on Mon May 8 2023 04:02:10 by doxygen 1.8.17 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.