stringutil.h
00001 /********************************************************************** 00002 ** Copyright (C) 2000-2002 Trolltech AS. All rights reserved. 00003 ** 00004 ** This file is part of the Qtopia Environment. 00005 ** 00006 ** This file may be distributed and/or modified under the terms of the 00007 ** GNU General Public License version 2 as published by the Free Software 00008 ** Foundation and appearing in the file LICENSE.GPL included in the 00009 ** packaging of this file. 00010 ** 00011 ** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE 00012 ** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. 00013 ** 00014 ** See http://www.trolltech.com/gpl/ for GPL licensing information. 00015 ** 00016 ** Contact info@trolltech.com if any conditions of this licensing are 00017 ** not clear to you. 00018 ** 00019 **********************************************************************/ 00020 00021 00022 #ifndef QTPALMTOP_stringutil_h__ 00023 #define QTPALMTOP_stringutil_h__ 00024 00025 #include <qstring.h> 00026 #include <qtopia/private/qpcglobal.h> 00027 00028 namespace Qtopia 00029 { 00030 00031 // Simplifies white space within each line but keeps the new line characters 00032 QString QPC_EXPORT simplifyMultiLineSpace( const QString &multiLine ); 00033 00034 // Creates a QString which doesn't contain any "dangerous" 00035 // characters (i.e. <, >, &, ") 00036 QString QPC_EXPORT escapeString( const QString& plain ); 00037 00038 // Takes a UTF-8!! string and removes all the XML thingies (entities?) 00039 // from the string and also calls fromUtf8() on it... so make sure 00040 // to pass a QCString/const char* with UTF-8 data only 00041 QString QPC_EXPORT plainString( const char* escaped, unsigned int length ); 00042 QString QPC_EXPORT plainString( const QCString& string ); 00043 00044 QString QPC_EXPORT plainString( const QString& string ); 00045 00046 00047 // collation functions 00048 int compare( const QString & s1, const QString & s2 ); 00049 QString buildSortKey( const QString & s ); 00050 QString buildSortKey( const QString & s1, const QString & s2 ); 00051 QString buildSortKey( const QString & s1, const QString & s2, 00052 const QString & s3 ); 00053 00054 } 00055 00056 #endif
