KItinerary::StringUtil

KItinerary::StringUtil Namespace Reference

Functions

QStringView betterString (QStringView lhs, QStringView rhs)
 
QChar normalize (QChar c)
 
QString normalize (QStringView str)
 
float prefixSimilarity (QStringView s1, QStringView s2)
 

Detailed Description

String normalization and comparison utilities.

Function Documentation

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 57 of file stringutil.cpp.

QChar KItinerary::StringUtil::normalize ( QChar  c)

Convert c to case-folded form and remove diacritic marks.

Definition at line 14 of file stringutil.cpp.

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

Strips out diacritics and converts to case-folded form.

only exported for unit tests

Definition at line 30 of file stringutil.cpp.

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.

only exported for unit tests

Definition at line 94 of file stringutil.cpp.

This file is part of the KDE documentation.
Documentation copyright © 1996-2021 The KDE developers.
Generated on Sun Dec 5 2021 23:05:21 by doxygen 1.8.11 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.