KCoreAddons

kstringhandler.h
1 /*
2  This file is part of the KDE libraries
3 
4  SPDX-FileCopyrightText: 1999 Ian Zepp <[email protected]>
5  SPDX-FileCopyrightText: 2000 Rik Hemsley (rikkus) <[email protected]>
6  SPDX-FileCopyrightText: 2006 Dominic Battre <[email protected]>
7  SPDX-FileCopyrightText: 2006 Martin Pool <[email protected]>
8 
9  SPDX-License-Identifier: LGPL-2.0-only
10 */
11 #ifndef KSTRINGHANDLER_H
12 #define KSTRINGHANDLER_H
13 
14 #include <kcoreaddons_export.h>
15 
16 #include <qnamespace.h>
17 
18 class QChar;
19 class QRegExp;
20 class QRegularExpression;
21 class QString;
22 class QStringList;
23 
50 namespace KStringHandler
51 {
52 
58 KCOREADDONS_EXPORT QString capwords(const QString &text);
59 
65 KCOREADDONS_EXPORT QStringList capwords(const QStringList &list);
66 
73 KCOREADDONS_EXPORT QString lsqueeze(const QString &str, int maxlen = 40);
74 
81 KCOREADDONS_EXPORT QString csqueeze(const QString &str, int maxlen = 40);
82 
89 KCOREADDONS_EXPORT QString rsqueeze(const QString &str, int maxlen = 40);
90 
108 KCOREADDONS_EXPORT QStringList perlSplit(const QString &sep,
109  const QString &s,
110  int max = 0);
111 
129 KCOREADDONS_EXPORT QStringList perlSplit(const QChar &sep,
130  const QString &s,
131  int max = 0);
132 
133 #if KCOREADDONS_ENABLE_DEPRECATED_SINCE(5, 67)
134 
154 KCOREADDONS_DEPRECATED_VERSION(5, 67, "Use KStringHandler::perlSplit(const QRegularExpression &, const QString &, int)")
155 KCOREADDONS_EXPORT QStringList perlSplit(const QRegExp &sep,
156  const QString &s,
157  int max = 0);
158 #endif
159 
179 KCOREADDONS_EXPORT QStringList perlSplit(const QRegularExpression &sep,
180  const QString &s, int max = 0);
181 
188 KCOREADDONS_EXPORT QString tagUrls(const QString &text);
189 
202 KCOREADDONS_EXPORT QString obscure(const QString &str);
203 
210 KCOREADDONS_EXPORT bool isUtf8(const char *str);
211 
221 KCOREADDONS_EXPORT QString from8Bit(const char *str);
222 
236 KCOREADDONS_EXPORT QString preProcessWrap(const QString &text);
237 
245 KCOREADDONS_EXPORT int logicalLength(const QString &text);
246 
247 }
248 #endif
KCOREADDONS_EXPORT int logicalLength(const QString &text)
Returns the length that reflects the density of information in the text.
KCOREADDONS_EXPORT QString from8Bit(const char *str)
Construct QString from a c string, guessing whether it is UTF8- or Local8Bit-encoded.
KCOREADDONS_EXPORT QString rsqueeze(const QString &str, int maxlen=40)
Substitute characters at the end of a string by "...".
This namespace contains utility functions for handling strings.
KCOREADDONS_EXPORT QString preProcessWrap(const QString &text)
Preprocesses the given string in order to provide additional line breaking opportunities for QTextLay...
KCOREADDONS_EXPORT bool isUtf8(const char *str)
Guess whether a string is UTF8 encoded.
KCOREADDONS_EXPORT QString csqueeze(const QString &str, int maxlen=40)
Substitute characters at the middle of a string by "...".
KCOREADDONS_EXPORT QStringList perlSplit(const QString &sep, const QString &s, int max=0)
Split a QString into a QStringList in a similar fashion to the static QStringList function in Qt...
KCOREADDONS_EXPORT QString capwords(const QString &text)
Capitalizes each word in the string "hello there" becomes "Hello There" (string)
KCOREADDONS_EXPORT QString lsqueeze(const QString &str, int maxlen=40)
Substitute characters at the beginning of a string by "...".
KCOREADDONS_EXPORT QString obscure(const QString &str)
Obscure string by using a simple symmetric encryption.
KCOREADDONS_EXPORT QString tagUrls(const QString &text)
This method auto-detects URLs in strings, and adds HTML markup to them so that richtext or HTML-enabl...
This file is part of the KDE documentation.
Documentation copyright © 1996-2020 The KDE developers.
Generated on Sat May 30 2020 23:10:51 by doxygen 1.8.11 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.