KItinerary

stringutil.h
1/*
2 SPDX-FileCopyrightText: 2018 Volker Krause <vkrause@kde.org>
3
4 SPDX-License-Identifier: LGPL-2.0-or-later
5*/
6
7#pragma once
8
9class QByteArray;
10class QString;
11class QStringView;
12
13namespace KItinerary {
14
15/** String normalization and comparison utilities. */
16namespace StringUtil
17{
18 /** Strips out diacritics and converts to case-folded form. */
20
21 /** Assuming both sides are describing the same thing, this tries to find the "better" string.
22 * That is, prefer the one that didn't lose casing/unicode/etc in previous processing.
23 */
25
26 /** Returns how much of the prefix of two given strings are equal, in
27 * relation to the longer of the two input strings.
28 */
30
31 /** Cleans up extra white spaces and XML entities from @p s. */
32 QString clean(const QString &s);
33
34 /** Transliterate diacritics or other special characters. */
36
37 /** Same as QByteArray::startsWith, but ignoring leading whitespaces. */
38 bool startsWithIgnoreSpace(const QByteArray &data, const char *pattern);
39}
40
41}
42
bool startsWithIgnoreSpace(const QByteArray &data, const char *pattern)
Same as QByteArray::startsWith, but ignoring leading whitespaces.
QString clean(const QString &s)
Cleans up extra white spaces and XML entities from s.
QString normalize(QStringView str)
Strips out diacritics and converts to case-folded form.
QString transliterate(QStringView s)
Transliterate diacritics or other special characters.
float 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 i...
QStringView betterString(QStringView lhs, QStringView rhs)
Assuming both sides are describing the same thing, this tries to find the "better" string.
Classes for reservation/travel data models, data extraction and data augmentation.
Definition berelement.h:17
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Tue Mar 26 2024 11:14:49 by doxygen 1.10.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.