kstringhandler.h
/* This file is part of the KDE libraries
Copyright (C) 1999 Ian Zepp (icszepp@islc.net)
Copyright (C) 2000 Rik Hemsley (rikkus) <rik@kde.org>
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Library General Public
License version 2 as published by the Free Software Foundation.
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Library General Public License for more details.
You should have received a copy of the GNU Library General Public License
along with this library; see the file COPYING.LIB. If not, write to
the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
Boston, MA 02110-1301, USA.
*/
#ifndef KSTRINGHANDLER_H
#define KSTRINGHANDLER_H
#include <qstring.h>
#include <qstringlist.h>
#include <qregexp.h> // for the word ranges
#include <qfontmetrics.h>
#include "kdelibs_export.h"
class KDECORE_EXPORT KStringHandler
{
public:
static QString word( const QString &text , uint pos ) KDE_DEPRECATED;
static QString word( const QString &text , const char *range );
static QString insword( const QString &text , const QString &word , uint pos );
static QString setword( const QString &text , const QString &word , uint pos );
static QString remrange( const QString &text , const char *range );
static QString remword( const QString &text , uint pos );
static QString remword( const QString &text , const QString &word );
static QString capwords( const QString &text );
static QStringList capwords( const QStringList &list );
static QString reverse( const QString &text );
static QStringList reverse( const QStringList &list );
static QString ljust( const QString &text , uint width ) KDE_DEPRECATED;
static QString rjust( const QString &text , uint width ) KDE_DEPRECATED;
static QString center( const QString &text , uint width );
static QString lsqueeze( const QString & str, uint maxlen = 40 );
static QString lEmSqueeze( const QString & name,
const QFontMetrics& fontMetrics,
uint maxlen = 30 );
static QString lPixelSqueeze( const QString & name,
const QFontMetrics& fontMetrics,
uint maxPixels );
static QString csqueeze( const QString & str, uint maxlen = 40 );
static QString cEmSqueeze( const QString & name,
const QFontMetrics& fontMetrics,
uint maxlen = 30 );
static QString cPixelSqueeze( const QString & name,
const QFontMetrics& fontMetrics,
uint maxPixels );
static QString rsqueeze( const QString & str, uint maxlen = 40 );
static QString rEmSqueeze( const QString & name,
const QFontMetrics& fontMetrics,
uint maxlen = 30 );
static QString rPixelSqueeze( const QString & name,
const QFontMetrics& fontMetrics,
uint maxPixels );
static bool matchFileName( const QString& filename, const QString& pattern );
// KDE4: move to KShell
static QStringList perlSplit
(const QString & sep, const QString & s, uint max = 0);
static QStringList perlSplit
(const QChar & sep, const QString & s, uint max = 0);
static QStringList perlSplit
(const QRegExp & sep, const QString & s, uint max = 0);
static QString tagURLs( const QString& text );
static QString obscure( const QString &str );
static bool isUtf8( const char *str );
static QString from8Bit( const char *str );
#ifdef KDE_NO_COMPAT
private:
#endif
static KDE_DEPRECATED bool matchFilename( const QString& filename, const QString& pattern )
{
return matchFileName (filename, pattern);
}
};
#endif
KStringHandler::matchFilename
static KDE_DEPRECATED bool matchFilename(const QString &filename, const QString &pattern)
Definition: kstringhandler.h:435
KStringHandler
This class contains utility functions for handling strings.
Definition: kstringhandler.h:69

KDE Home | KDE Accessibility Home | Description of Access Keys