KItinerary::StringUtil

KItinerary::StringUtil Namespace Reference

Functions

QStringView betterString (QStringView lhs, QStringView rhs)
 
QString clean (const QString &s)
 
QString normalize (QStringView str)
 
float prefixSimilarity (QStringView s1, QStringView s2)
 
bool startsWithIgnoreSpace (const QByteArray &data, const char *pattern)
 
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 79 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 154 of file stringutil.cpp.

◆ normalize()

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

Strips out diacritics and converts to case-folded form.

Definition at line 19 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 134 of file stringutil.cpp.

◆ startsWithIgnoreSpace()

bool KItinerary::StringUtil::startsWithIgnoreSpace ( const QByteArray & data,
const char * pattern )

Same as QByteArray::startsWith, but ignoring leading whitespaces.

Definition at line 195 of file stringutil.cpp.

◆ transliterate()

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

Transliterate diacritics or other special characters.

Definition at line 171 of file stringutil.cpp.

This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Fri Jun 14 2024 11:54:40 by doxygen 1.10.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.