• Skip to content
  • Skip to link menu
KDE API Reference
  • KDE API Reference
  • kdelibs API Reference
  • KDE Home
  • Contact Us
 

KDECore

  • sources
  • kde-4.14
  • kdelibs
  • kdecore
  • text
kstringhandler.h
Go to the documentation of this file.
1 /* This file is part of the KDE libraries
2  Copyright (C) 1999 Ian Zepp (icszepp@islc.net)
3  Copyright (C) 2000 Rik Hemsley (rikkus) <rik@kde.org>
4  Copyright (C) 2006 by Dominic Battre <dominic@battre.de>
5  Copyright (C) 2006 by Martin Pool <mbp@canonical.com>
6 
7  This library is free software; you can redistribute it and/or
8  modify it under the terms of the GNU Library General Public
9  License version 2 as published by the Free Software Foundation.
10 
11  This library is distributed in the hope that it will be useful,
12  but WITHOUT ANY WARRANTY; without even the implied warranty of
13  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14  Library General Public License for more details.
15 
16  You should have received a copy of the GNU Library General Public License
17  along with this library; see the file COPYING.LIB. If not, write to
18  the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
19  Boston, MA 02110-1301, USA.
20 */
21 #ifndef KSTRINGHANDLER_H
22 #define KSTRINGHANDLER_H
23 
24 #include <kdecore_export.h>
25 
26 #include <QtCore/qnamespace.h>
27 
28 class QChar;
29 class QRegExp;
30 class QString;
31 class QStringList;
32 
59 namespace KStringHandler
60 {
61 
67  KDECORE_EXPORT QString capwords( const QString &text );
68 
74  KDECORE_EXPORT QStringList capwords( const QStringList &list );
75 
82  KDECORE_EXPORT QString lsqueeze( const QString & str, int maxlen = 40 );
83 
90  KDECORE_EXPORT QString csqueeze( const QString & str, int maxlen = 40 );
91 
98  KDECORE_EXPORT QString rsqueeze( const QString & str, int maxlen = 40 );
99 
117  KDECORE_EXPORT QStringList perlSplit( const QString & sep,
118  const QString & s,
119  int max = 0 );
120 
138  KDECORE_EXPORT QStringList perlSplit( const QChar & sep,
139  const QString & s,
140  int max = 0 );
141 
159  KDECORE_EXPORT QStringList perlSplit( const QRegExp & sep,
160  const QString & s,
161  int max = 0);
162 
169  KDECORE_EXPORT QString tagUrls( const QString& text );
170 
183  KDECORE_EXPORT QString obscure( const QString &str );
184 
185 
192  KDECORE_EXPORT bool isUtf8( const char *str );
193 
203  KDECORE_EXPORT QString from8Bit( const char *str );
204 
216  KDECORE_EXPORT int naturalCompare( const QString& a, const QString& b, Qt::CaseSensitivity caseSensitivity = Qt::CaseSensitive );
217 
231  KDECORE_EXPORT QString preProcessWrap( const QString& text );
232 }
233 #endif
KStringHandler::from8Bit
QString from8Bit(const char *str)
Construct QString from a c string, guessing whether it is UTF8- or Local8Bit-encoded.
Definition: kstringhandler.cpp:289
KStringHandler::naturalCompare
int naturalCompare(const QString &a, const QString &b, Qt::CaseSensitivity caseSensitivity=Qt::CaseSensitive)
Does a natural comparing of the strings.
Definition: kstringhandler.cpp:302
KStringHandler::rsqueeze
QString rsqueeze(const QString &str, int maxlen=40)
Substitute characters at the end of a string by "...".
Definition: kstringhandler.cpp:80
kdecore_export.h
QChar
QRegExp
KStringHandler::preProcessWrap
QString preProcessWrap(const QString &text)
Preprocesses the given string in order to provide additional line breaking opportunities for QTextLay...
Definition: kstringhandler.cpp:453
KStringHandler::isUtf8
bool isUtf8(const char *str)
Guess whether a string is UTF8 encoded.
Definition: kstringhandler.cpp:204
KStringHandler::csqueeze
QString csqueeze(const QString &str, int maxlen=40)
Substitute characters at the middle of a string by "...".
Definition: kstringhandler.cpp:71
QString
QStringList
KStringHandler::perlSplit
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...
Definition: kstringhandler.cpp:89
KStringHandler::capwords
QString capwords(const QString &text)
Capitalizes each word in the string "hello there" becomes "Hello There" (string)
Definition: kstringhandler.cpp:37
KStringHandler::lsqueeze
QString lsqueeze(const QString &str, int maxlen=40)
Substitute characters at the beginning of a string by "...".
Definition: kstringhandler.cpp:62
KStringHandler::obscure
QString obscure(const QString &str)
Obscure string by using a simple symmetric encryption.
Definition: kstringhandler.cpp:190
KStringHandler::tagUrls
QString tagUrls(const QString &text)
This method auto-detects URLs in strings, and adds HTML markup to them so that richtext or HTML-enabl...
Definition: kstringhandler.cpp:165
This file is part of the KDE documentation.
Documentation copyright © 1996-2020 The KDE developers.
Generated on Mon Jun 22 2020 13:22:11 by doxygen 1.8.7 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.

KDECore

Skip menu "KDECore"
  • Main Page
  • Namespace List
  • Namespace Members
  • Alphabetical List
  • Class List
  • Class Hierarchy
  • Class Members
  • File List
  • File Members
  • Modules
  • Related Pages

kdelibs API Reference

Skip menu "kdelibs API Reference"
  • DNSSD
  • Interfaces
  •   KHexEdit
  •   KMediaPlayer
  •   KSpeech
  •   KTextEditor
  • kconf_update
  • KDE3Support
  •   KUnitTest
  • KDECore
  • KDED
  • KDEsu
  • KDEUI
  • KDEWebKit
  • KDocTools
  • KFile
  • KHTML
  • KImgIO
  • KInit
  • kio
  • KIOSlave
  • KJS
  •   KJS-API
  •   WTF
  • kjsembed
  • KNewStuff
  • KParts
  • KPty
  • Kross
  • KUnitConversion
  • KUtils
  • Nepomuk
  • Plasma
  • Solid
  • Sonnet
  • ThreadWeaver

Search



Report problems with this website to our bug tracking system.
Contact the specific authors with questions and comments about the page contents.

KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal