- Main Page
- Related Pages
- Modules
- Namespaces
- Classes
- Files
- Directories
- Examples

- File List
- File Members

# qstring.h

Go to the documentation of this file.

    00001 /****************************************************************************
    00002 **
    00003 ** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
    00004 ** All rights reserved.
    00005 ** Contact: Nokia Corporation (qt-info@nokia.com)
    00006 **
    00007 ** This file is part of the QtCore module of the Qt Toolkit.
    00008 **
    00009 ** $QT_BEGIN_LICENSE:LGPL$
    00010 ** Commercial Usage
    00011 ** Licensees holding valid Qt Commercial licenses may use this file in
    00012 ** accordance with the Qt Commercial License Agreement provided with the
    00013 ** Software or, alternatively, in accordance with the terms contained in
    00014 ** a written agreement between you and Nokia.
    00015 **
    00016 ** GNU Lesser General Public License Usage
    00017 ** Alternatively, this file may be used under the terms of the GNU Lesser
    00018 ** General Public License version 2.1 as published by the Free Software
    00019 ** Foundation and appearing in the file LICENSE.LGPL included in the
    00020 ** packaging of this file.  Please review the following information to
    00021 ** ensure the GNU Lesser General Public License version 2.1 requirements
    00022 ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
    00023 **
    00024 ** In addition, as a special exception, Nokia gives you certain additional
    00025 ** rights.  These rights are described in the Nokia Qt LGPL Exception
    00026 ** version 1.1, included in the file LGPL_EXCEPTION.txt in this module.
    00027 **
    00028 ** GNU General Public License Usage
    00029 ** Alternatively, this file may be used under the terms of the GNU
    00030 ** General Public License version 3.0 as published by the Free Software
    00031 ** Foundation and appearing in the file LICENSE.GPL included in the
    00032 ** packaging of this file.  Please review the following information to
    00033 ** ensure the GNU General Public License version 3.0 requirements will be
    00034 ** met: http://www.gnu.org/copyleft/gpl.html.
    00035 **
    00036 ** If you have questions regarding the use of this file, please contact
    00037 ** Nokia at qt-info@nokia.com.
    00038 ** $QT_END_LICENSE$
    00039 **
    00040 ****************************************************************************/
    00041
    00042 #ifndef QSTRING_H
    00043 #define QSTRING_H
    00044
    00045 #include <QtCore/qchar.h>
    00046 #include <QtCore/qbytearray.h>
    00047 #include <QtCore/qatomic.h>
    00048 #include <QtCore/qnamespace.h>
    00049 #ifdef QT_INCLUDE_COMPAT
    00050 #include <Qt3Support/q3cstring.h>
    00051 #endif
    00052
    00053 #ifndef QT_NO_STL
    00054 #  if defined (Q_CC_MSVC_NET) && _MSC_VER < 1310 // Avoids nasty warning for xlocale, line 450
    00055 #    pragma warning (push)
    00056 #    pragma warning (disable : 4189)
    00057 #    include <string>
    00058 #    pragma warning (pop)
    00059 #  else
    00060 #    include <string>
    00061 #  endif
    00062
    00063 #  ifndef QT_NO_STL_WCHAR
    00064 // workaround for some headers not typedef'ing std::wstring
    00065 typedef std::basic_string<wchar_t> QStdWString;
    00066 #  endif // QT_NO_STL_WCHAR
    00067
    00068 #endif // QT_NO_STL
    00069
    00070 #include <stdarg.h>
    00071
    00072 #ifdef truncate
    00073 #error qstring.h must be included before any header file that defines truncate
    00074 #endif
    00075
    00076 #if defined(Q_CC_GNU) && (__GNUC__ == 4 && __GNUC_MINOR__ == 0)
    00077 //There is a bug in GCC 4.0 that tries to instantiate template of annonymous enum
    00078 #  ifdef QT_USE_FAST_OPERATOR_PLUS
    00079 #    undef QT_USE_FAST_OPERATOR_PLUS
    00080 #  endif
    00081 #  ifdef QT_USE_FAST_CONCATENATION
    00082 #    undef QT_USE_FAST_CONCATENATION
    00083 #  endif
    00084 #endif
    00085
    00086 QT_BEGIN_HEADER
    00087
    00088 QT_BEGIN_NAMESPACE
    00089
    00090 QT_MODULE(Core)
    00091
    00092 class QCharRef;
    00093 class QRegExp;
    00094 class QStringList;
    00095 class QTextCodec;
    00096 class QLatin1String;
    00097 class QStringRef;
    00098 template <typename T> class QVector;
    00099
    00100 class Q_CORE_EXPORT QString
    00101 {
    00102 public:
    00103     inline QString();
    00104     QString(const QChar *unicode, int size); // Qt5: don't cap size < 0
    00105     explicit QString(const QChar *unicode); // Qt5: merge with the above
    00106     QString(QChar c);
    00107     QString(int size, QChar c);
    00108     inline QString(const QLatin1String &latin1);
    00109     inline QString(const QString &);
    00110     inline ~QString();
    00111     QString &operator=(QChar c);
    00112     QString &operator=(const QString &);
    00113     inline QString &operator=(const QLatin1String &);
    00114
    00115     inline int size() const { return d->size; }
    00116     inline int count() const { return d->size; }
    00117     inline int length() const;
    00118     inline bool isEmpty() const;
    00119     void resize(int size);
    00120
    00121     QString &fill(QChar c, int size = -1);
    00122     void truncate(int pos);
    00123     void chop(int n);
    00124
    00125     int capacity() const;
    00126     inline void reserve(int size);
    00127     inline void squeeze() { if (d->size < d->alloc || d->ref != 1) realloc(); d->capacity = 0;}
    00128
    00129     inline const QChar *unicode() const;
    00130     inline QChar *data();
    00131     inline const QChar *data() const;
    00132     inline const QChar *constData() const;
    00133
    00134     inline void detach();
    00135     inline bool isDetached() const;
    00136     inline bool isSharedWith(const QString &other) const { return d == other.d; }
    00137     void clear();
    00138
    00139     inline const QChar at(int i) const;
    00140     const QChar operator[](int i) const;
    00141     QCharRef operator[](int i);
    00142     const QChar operator[](uint i) const;
    00143     QCharRef operator[](uint i);
    00144
    00145     QString arg(qlonglong a, int fieldwidth=0, int base=10,
    00146                 const QChar &fillChar = QLatin1Char(' ')) const Q_REQUIRED_RESULT;
    00147     QString arg(qulonglong a, int fieldwidth=0, int base=10,
    00148                 const QChar &fillChar = QLatin1Char(' ')) const Q_REQUIRED_RESULT;
    00149     QString arg(long a, int fieldwidth=0, int base=10,
    00150                 const QChar &fillChar = QLatin1Char(' ')) const Q_REQUIRED_RESULT;
    00151     QString arg(ulong a, int fieldwidth=0, int base=10,
    00152                 const QChar &fillChar = QLatin1Char(' ')) const Q_REQUIRED_RESULT;
    00153     QString arg(int a, int fieldWidth = 0, int base = 10,
    00154                 const QChar &fillChar = QLatin1Char(' ')) const Q_REQUIRED_RESULT;
    00155     QString arg(uint a, int fieldWidth = 0, int base = 10,
    00156                 const QChar &fillChar = QLatin1Char(' ')) const Q_REQUIRED_RESULT;
    00157     QString arg(short a, int fieldWidth = 0, int base = 10,
    00158                 const QChar &fillChar = QLatin1Char(' ')) const Q_REQUIRED_RESULT;
    00159     QString arg(ushort a, int fieldWidth = 0, int base = 10,
    00160                 const QChar &fillChar = QLatin1Char(' ')) const Q_REQUIRED_RESULT;
    00161     QString arg(double a, int fieldWidth = 0, char fmt = 'g', int prec = -1,
    00162                 const QChar &fillChar = QLatin1Char(' ')) const Q_REQUIRED_RESULT;
    00163     QString arg(char a, int fieldWidth = 0,
    00164                 const QChar &fillChar = QLatin1Char(' ')) const Q_REQUIRED_RESULT;
    00165     QString arg(QChar a, int fieldWidth = 0,
    00166                 const QChar &fillChar = QLatin1Char(' ')) const Q_REQUIRED_RESULT;
    00167     QString arg(const QString &a, int fieldWidth = 0,
    00168                 const QChar &fillChar = QLatin1Char(' ')) const Q_REQUIRED_RESULT;
    00169     QString arg(const QString &a1, const QString &a2) const Q_REQUIRED_RESULT;
    00170     QString arg(const QString &a1, const QString &a2, const QString &a3) const Q_REQUIRED_RESULT;
    00171     QString arg(const QString &a1, const QString &a2, const QString &a3,
    00172                 const QString &a4) const Q_REQUIRED_RESULT;
    00173     QString arg(const QString &a1, const QString &a2, const QString &a3,
    00174                 const QString &a4, const QString &a5) const Q_REQUIRED_RESULT;
    00175     QString arg(const QString &a1, const QString &a2, const QString &a3,
    00176                 const QString &a4, const QString &a5, const QString &a6) const Q_REQUIRED_RESULT;
    00177     QString arg(const QString &a1, const QString &a2, const QString &a3,
    00178                 const QString &a4, const QString &a5, const QString &a6,
    00179                 const QString &a7) const Q_REQUIRED_RESULT;
    00180     QString arg(const QString &a1, const QString &a2, const QString &a3,
    00181                 const QString &a4, const QString &a5, const QString &a6,
    00182                 const QString &a7, const QString &a8) const Q_REQUIRED_RESULT;
    00183     QString arg(const QString &a1, const QString &a2, const QString &a3,
    00184                 const QString &a4, const QString &a5, const QString &a6,
    00185                 const QString &a7, const QString &a8, const QString &a9) const Q_REQUIRED_RESULT;
    00186
    00187     QString    &vsprintf(const char *format, va_list ap)
    00188 #if defined(Q_CC_GNU) && !defined(__INSURE__)
    00189         __attribute__ ((format (printf, 2, 0)))
    00190 #endif
    00191         ;
    00192     QString    &sprintf(const char *format, ...)
    00193 #if defined(Q_CC_GNU) && !defined(__INSURE__)
    00194         __attribute__ ((format (printf, 2, 3)))
    00195 #endif
    00196         ;
    00197
    00198     int indexOf(QChar c, int from = 0, Qt::CaseSensitivity cs = Qt::CaseSensitive) const;
    00199     int indexOf(const QString &s, int from = 0, Qt::CaseSensitivity cs = Qt::CaseSensitive) const;
    00200     int indexOf(const QLatin1String &s, int from = 0, Qt::CaseSensitivity cs = Qt::CaseSensitive) const;
    00201     int lastIndexOf(QChar c, int from = -1, Qt::CaseSensitivity cs = Qt::CaseSensitive) const;
    00202     int lastIndexOf(const QString &s, int from = -1, Qt::CaseSensitivity cs = Qt::CaseSensitive) const;
    00203     int lastIndexOf(const QLatin1String &s, int from = -1, Qt::CaseSensitivity cs = Qt::CaseSensitive) const;
    00204
    00205     inline QBool contains(QChar c, Qt::CaseSensitivity cs = Qt::CaseSensitive) const;
    00206     inline QBool contains(const QString &s, Qt::CaseSensitivity cs = Qt::CaseSensitive) const;
    00207     int count(QChar c, Qt::CaseSensitivity cs = Qt::CaseSensitive) const;
    00208     int count(const QString &s, Qt::CaseSensitivity cs = Qt::CaseSensitive) const;
    00209
    00210 #ifndef QT_NO_REGEXP
    00211     int indexOf(const QRegExp &, int from = 0) const;
    00212     int lastIndexOf(const QRegExp &, int from = -1) const;
    00213     inline QBool contains(const QRegExp &rx) const { return QBool(indexOf(rx) != -1); }
    00214     int count(const QRegExp &) const;
    00215
    00216     int indexOf(QRegExp &, int from = 0) const;
    00217     int lastIndexOf(QRegExp &, int from = -1) const;
    00218     inline QBool contains(QRegExp &rx) const { return QBool(indexOf(rx) != -1); }
    00219 #endif
    00220
    00221     enum SectionFlag {
    00222         SectionDefault             = 0x00,
    00223         SectionSkipEmpty           = 0x01,
    00224         SectionIncludeLeadingSep   = 0x02,
    00225         SectionIncludeTrailingSep  = 0x04,
    00226         SectionCaseInsensitiveSeps = 0x08
    00227     };
    00228     Q_DECLARE_FLAGS(SectionFlags, SectionFlag)
    00229
    00230     QString section(QChar sep, int start, int end = -1, SectionFlags flags = SectionDefault) const;
    00231     QString section(const QString &in_sep, int start, int end = -1, SectionFlags flags = SectionDefault) const;
    00232 #ifndef QT_NO_REGEXP
    00233     QString section(const QRegExp &reg, int start, int end = -1, SectionFlags flags = SectionDefault) const;
    00234 #endif
    00235
    00236     QString left(int n) const Q_REQUIRED_RESULT;
    00237     QString right(int n) const Q_REQUIRED_RESULT;
    00238     QString mid(int position, int n = -1) const Q_REQUIRED_RESULT;
    00239     QStringRef leftRef(int n) const Q_REQUIRED_RESULT;
    00240     QStringRef rightRef(int n) const Q_REQUIRED_RESULT;
    00241     QStringRef midRef(int position, int n = -1) const Q_REQUIRED_RESULT;
    00242
    00243     bool startsWith(const QString &s, Qt::CaseSensitivity cs = Qt::CaseSensitive) const;
    00244     bool startsWith(const QLatin1String &s, Qt::CaseSensitivity cs = Qt::CaseSensitive) const;
    00245     bool startsWith(const QChar &c, Qt::CaseSensitivity cs = Qt::CaseSensitive) const;
    00246     bool endsWith(const QString &s, Qt::CaseSensitivity cs = Qt::CaseSensitive) const;
    00247     bool endsWith(const QLatin1String &s, Qt::CaseSensitivity cs = Qt::CaseSensitive) const;
    00248     bool endsWith(const QChar &c, Qt::CaseSensitivity cs = Qt::CaseSensitive) const;
    00249
    00250     QString leftJustified(int width, QChar fill = QLatin1Char(' '), bool trunc = false) const Q_REQUIRED_RESULT;
    00251     QString rightJustified(int width, QChar fill = QLatin1Char(' '), bool trunc = false) const Q_REQUIRED_RESULT;
    00252
    00253     QString toLower() const Q_REQUIRED_RESULT;
    00254     QString toUpper() const Q_REQUIRED_RESULT;
    00255     QString toCaseFolded() const Q_REQUIRED_RESULT;
    00256
    00257     QString trimmed() const Q_REQUIRED_RESULT;
    00258     QString simplified() const Q_REQUIRED_RESULT;
    00259
    00260     QString &insert(int i, QChar c);
    00261     QString &insert(int i, const QChar *uc, int len);
    00262     inline QString &insert(int i, const QString &s) { return insert(i, s.constData(), s.length()); }
    00263     QString &insert(int i, const QLatin1String &s);
    00264     QString &append(QChar c);
    00265     QString &append(const QString &s);
    00266     QString &append(const QStringRef &s);
    00267     QString &append(const QLatin1String &s);
    00268     inline QString &prepend(QChar c) { return insert(0, c); }
    00269     inline QString &prepend(const QString &s) { return insert(0, s); }
    00270     inline QString &prepend(const QLatin1String &s) { return insert(0, s); }
    00271
    00272     inline QString &operator+=(QChar c) {
    00273         if (d->ref != 1 || d->size + 1 > d->alloc)
    00274             realloc(grow(d->size + 1));
    00275         d->data[d->size++] = c.unicode();
    00276         d->data[d->size] = '\0';
    00277         return *this;
    00278     }
    00279
    00280     inline QString &operator+=(QChar::SpecialCharacter c) { return append(QChar(c)); }
    00281     inline QString &operator+=(const QString &s) { return append(s); }
    00282     inline QString &operator+=(const QStringRef &s) { return append(s); }
    00283     inline QString &operator+=(const QLatin1String &s) { return append(s); }
    00284
    00285     QString &remove(int i, int len);
    00286     QString &remove(QChar c, Qt::CaseSensitivity cs = Qt::CaseSensitive);
    00287     QString &remove(const QString &s, Qt::CaseSensitivity cs = Qt::CaseSensitive);
    00288     QString &replace(int i, int len, QChar after);
    00289     QString &replace(int i, int len, const QChar *s, int slen);
    00290     QString &replace(int i, int len, const QString &after);
    00291     QString &replace(QChar before, QChar after, Qt::CaseSensitivity cs = Qt::CaseSensitive);
    00292     QString &replace(const QChar *before, int blen, const QChar *after, int alen, Qt::CaseSensitivity cs = Qt::CaseSensitive);
    00293     QString &replace(const QLatin1String &before, const QLatin1String &after, Qt::CaseSensitivity cs = Qt::CaseSensitive);
    00294     QString &replace(const QLatin1String &before, const QString &after, Qt::CaseSensitivity cs = Qt::CaseSensitive);
    00295     QString &replace(const QString &before, const QLatin1String &after, Qt::CaseSensitivity cs = Qt::CaseSensitive);
    00296     QString &replace(const QString &before, const QString &after,
    00297                      Qt::CaseSensitivity cs = Qt::CaseSensitive);
    00298     QString &replace(QChar c, const QString &after, Qt::CaseSensitivity cs = Qt::CaseSensitive);
    00299     QString &replace(QChar c, const QLatin1String &after, Qt::CaseSensitivity cs = Qt::CaseSensitive);
    00300 #ifndef QT_NO_REGEXP
    00301     QString &replace(const QRegExp &rx, const QString &after);
    00302     inline QString &remove(const QRegExp &rx)
    00303     { return replace(rx, QString()); }
    00304 #endif
    00305
    00306     enum SplitBehavior { KeepEmptyParts, SkipEmptyParts };
    00307
    00308     QStringList split(const QString &sep, SplitBehavior behavior = KeepEmptyParts,
    00309                       Qt::CaseSensitivity cs = Qt::CaseSensitive) const Q_REQUIRED_RESULT;
    00310     QStringList split(const QChar &sep, SplitBehavior behavior = KeepEmptyParts,
    00311                       Qt::CaseSensitivity cs = Qt::CaseSensitive) const Q_REQUIRED_RESULT;
    00312 #ifndef QT_NO_REGEXP
    00313     QStringList split(const QRegExp &sep, SplitBehavior behavior = KeepEmptyParts) const Q_REQUIRED_RESULT;
    00314 #endif
    00315
    00316     enum NormalizationForm {
    00317         NormalizationForm_D,
    00318         NormalizationForm_C,
    00319         NormalizationForm_KD,
    00320         NormalizationForm_KC
    00321     };
    00322     QString normalized(NormalizationForm mode) const Q_REQUIRED_RESULT;
    00323     QString normalized(NormalizationForm mode, QChar::UnicodeVersion version) const Q_REQUIRED_RESULT;
    00324
    00325     QString repeated(int times) const;
    00326
    00327     const ushort *utf16() const;
    00328
    00329     QByteArray toAscii() const Q_REQUIRED_RESULT;
    00330     QByteArray toLatin1() const Q_REQUIRED_RESULT;
    00331     QByteArray toUtf8() const Q_REQUIRED_RESULT;
    00332     QByteArray toLocal8Bit() const Q_REQUIRED_RESULT;
    00333     QVector<uint> toUcs4() const Q_REQUIRED_RESULT;
    00334
    00335     static QString fromAscii(const char *, int size = -1);
    00336     static QString fromLatin1(const char *, int size = -1);
    00337     static QString fromUtf8(const char *, int size = -1);
    00338     static QString fromLocal8Bit(const char *, int size = -1);
    00339     static QString fromUtf16(const ushort *, int size = -1);
    00340     static QString fromUcs4(const uint *, int size = -1);
    00341     static QString fromRawData(const QChar *, int size);
    00342
    00343     int toWCharArray(wchar_t *array) const;
    00344     static QString fromWCharArray(const wchar_t *, int size = -1);
    00345
    00346     QString &setRawData(const QChar *unicode, int size);
    00347     QString &setUnicode(const QChar *unicode, int size);
    00348     inline QString &setUtf16(const ushort *utf16, int size);
    00349
    00350     // ### Qt 5: merge these two functions
    00351     int compare(const QString &s) const;
    00352     int compare(const QString &s, Qt::CaseSensitivity cs) const;
    00353
    00354     int compare(const QLatin1String &other, Qt::CaseSensitivity cs = Qt::CaseSensitive) const;
    00355
    00356     // ### Qt 5: merge these two functions
    00357     static inline int compare(const QString &s1, const QString &s2)
    00358     { return s1.compare(s2); }
    00359     static inline int compare(const QString &s1, const QString &s2, Qt::CaseSensitivity cs)
    00360     { return s1.compare(s2, cs); }
    00361
    00362     static inline int compare(const QString& s1, const QLatin1String &s2,
    00363                               Qt::CaseSensitivity cs = Qt::CaseSensitive)
    00364     { return s1.compare(s2, cs); }
    00365     static inline int compare(const QLatin1String& s1, const QString &s2,
    00366                               Qt::CaseSensitivity cs = Qt::CaseSensitive)
    00367     { return -s2.compare(s1, cs); }
    00368
    00369     int compare(const QStringRef &s, Qt::CaseSensitivity cs = Qt::CaseSensitive) const;
    00370     static int compare(const QString &s1, const QStringRef &s2,
    00371                        Qt::CaseSensitivity = Qt::CaseSensitive);
    00372
    00373     int localeAwareCompare(const QString& s) const;
    00374     static int localeAwareCompare(const QString& s1, const QString& s2)
    00375     { return s1.localeAwareCompare(s2); }
    00376
    00377     int localeAwareCompare(const QStringRef &s) const;
    00378     static int localeAwareCompare(const QString& s1, const QStringRef& s2);
    00379
    00380     short  toShort(bool *ok=0, int base=10) const;
    00381     ushort toUShort(bool *ok=0, int base=10) const;
    00382     int toInt(bool *ok=0, int base=10) const;
    00383     uint toUInt(bool *ok=0, int base=10) const;
    00384     long toLong(bool *ok=0, int base=10) const;
    00385     ulong toULong(bool *ok=0, int base=10) const;
    00386     qlonglong toLongLong(bool *ok=0, int base=10) const;
    00387     qulonglong toULongLong(bool *ok=0, int base=10) const;
    00388     float toFloat(bool *ok=0) const;
    00389     double toDouble(bool *ok=0) const;
    00390
    00391     QString &setNum(short, int base=10);
    00392     QString &setNum(ushort, int base=10);
    00393     QString &setNum(int, int base=10);
    00394     QString &setNum(uint, int base=10);
    00395     QString &setNum(long, int base=10);
    00396     QString &setNum(ulong, int base=10);
    00397     QString &setNum(qlonglong, int base=10);
    00398     QString &setNum(qulonglong, int base=10);
    00399     QString &setNum(float, char f='g', int prec=6);
    00400     QString &setNum(double, char f='g', int prec=6);
    00401
    00402     static QString number(int, int base=10);
    00403     static QString number(uint, int base=10);
    00404     static QString number(long, int base=10);
    00405     static QString number(ulong, int base=10);
    00406     static QString number(qlonglong, int base=10);
    00407     static QString number(qulonglong, int base=10);
    00408     static QString number(double, char f='g', int prec=6);
    00409
    00410     bool operator==(const QString &s) const;
    00411     bool operator<(const QString &s) const;
    00412     inline bool operator>(const QString &s) const { return s < *this; }
    00413     inline bool operator!=(const QString &s) const { return !operator==(s); }
    00414     inline bool operator<=(const QString &s) const { return !operator>(s); }
    00415     inline bool operator>=(const QString &s) const { return !operator<(s); }
    00416
    00417     bool operator==(const QLatin1String &s) const;
    00418     bool operator<(const QLatin1String &s) const;
    00419     bool operator>(const QLatin1String &s) const;
    00420     inline bool operator!=(const QLatin1String &s) const { return !operator==(s); }
    00421     inline bool operator<=(const QLatin1String &s) const { return !operator>(s); }
    00422     inline bool operator>=(const QLatin1String &s) const { return !operator<(s); }
    00423
    00424     // ASCII compatibility
    00425 #ifndef QT_NO_CAST_FROM_ASCII
    00426     inline QT_ASCII_CAST_WARN_CONSTRUCTOR QString(const char *ch) : d(fromAscii_helper(ch))
    00427     {}
    00428     inline QT_ASCII_CAST_WARN_CONSTRUCTOR QString(const QByteArray &a)
    00429         : d(fromAscii_helper(a.constData(), qstrnlen(a.constData(), a.size())))
    00430     {}
    00431     inline QT_ASCII_CAST_WARN QString &operator=(const char *ch)
    00432     { return (*this = fromAscii(ch)); }
    00433     inline QT_ASCII_CAST_WARN QString &operator=(const QByteArray &a)
    00434     { return (*this = fromAscii(a.constData(), qstrnlen(a.constData(), a.size()))); }
    00435     inline QT_ASCII_CAST_WARN QString &operator=(char c)
    00436     { return (*this = QChar::fromAscii(c)); }
    00437
    00438     // these are needed, so it compiles with STL support enabled
    00439     inline QT_ASCII_CAST_WARN QString &prepend(const char *s)
    00440     { return prepend(QString::fromAscii(s)); }
    00441     inline QT_ASCII_CAST_WARN QString &prepend(const QByteArray &s)
    00442     { return prepend(QString::fromAscii(s.constData(), qstrnlen(s.constData(), s.size()))); }
    00443     inline QT_ASCII_CAST_WARN QString &append(const char *s)
    00444     { return append(QString::fromAscii(s)); }
    00445     inline QT_ASCII_CAST_WARN QString &append(const QByteArray &s)
    00446     { return append(QString::fromAscii(s.constData(), qstrnlen(s.constData(), s.size()))); }
    00447     inline QT_ASCII_CAST_WARN QString &operator+=(const char *s)
    00448     { return append(QString::fromAscii(s)); }
    00449     inline QT_ASCII_CAST_WARN QString &operator+=(const QByteArray &s)
    00450     { return append(QString::fromAscii(s.constData(), qstrnlen(s.constData(), s.size()))); }
    00451     inline QT_ASCII_CAST_WARN QString &operator+=(char c)
    00452     { return append(QChar::fromAscii(c)); }
    00453
    00454     inline QT_ASCII_CAST_WARN bool operator==(const char *s) const;
    00455     inline QT_ASCII_CAST_WARN bool operator!=(const char *s) const;
    00456     inline QT_ASCII_CAST_WARN bool operator<(const char *s) const;
    00457     inline QT_ASCII_CAST_WARN bool operator<=(const char *s2) const;
    00458     inline QT_ASCII_CAST_WARN bool operator>(const char *s2) const;
    00459     inline QT_ASCII_CAST_WARN bool operator>=(const char *s2) const;
    00460
    00461     inline QT_ASCII_CAST_WARN bool operator==(const QByteArray &s) const;
    00462     inline QT_ASCII_CAST_WARN bool operator!=(const QByteArray &s) const;
    00463     inline QT_ASCII_CAST_WARN bool operator<(const QByteArray &s) const
    00464     { return *this < QString::fromAscii(s.constData(), s.size()); }
    00465     inline QT_ASCII_CAST_WARN bool operator>(const QByteArray &s) const
    00466     { return *this > QString::fromAscii(s.constData(), s.size()); }
    00467     inline QT_ASCII_CAST_WARN bool operator<=(const QByteArray &s) const
    00468     { return *this <= QString::fromAscii(s.constData(), s.size()); }
    00469     inline QT_ASCII_CAST_WARN bool operator>=(const QByteArray &s) const
    00470     { return *this >= QString::fromAscii(s.constData(), s.size()); }
    00471 #endif
    00472
    00473     typedef QChar *iterator;
    00474     typedef const QChar *const_iterator;
    00475     typedef iterator Iterator;
    00476     typedef const_iterator ConstIterator;
    00477     iterator begin();
    00478     const_iterator begin() const;
    00479     const_iterator constBegin() const;
    00480     iterator end();
    00481     const_iterator end() const;
    00482     const_iterator constEnd() const;
    00483
    00484     // STL compatibility
    00485     inline void push_back(QChar c) { append(c); }
    00486     inline void push_back(const QString &s) { append(s); }
    00487     inline void push_front(QChar c) { prepend(c); }
    00488     inline void push_front(const QString &s) { prepend(s); }
    00489
    00490 #ifndef QT_NO_STL
    00491     static inline QString fromStdString(const std::string &s);
    00492     inline std::string toStdString() const;
    00493 # ifdef qdoc
    00494     static inline QString fromStdWString(const std::wstring &s);
    00495     inline std::wstring toStdWString() const;
    00496 # else
    00497 #  ifndef QT_NO_STL_WCHAR
    00498     static inline QString fromStdWString(const QStdWString &s);
    00499     inline QStdWString toStdWString() const;
    00500 #  endif // QT_NO_STL_WCHAR
    00501 # endif // qdoc
    00502 #endif
    00503
    00504     // compatibility
    00505     struct Null { };
    00506     static const Null null;
    00507     inline QString(const Null &): d(&shared_null) { d->ref.ref(); }
    00508     inline QString &operator=(const Null &) { *this = QString(); return *this; }
    00509     inline bool isNull() const { return d == &shared_null; }
    00510
    00511 #ifdef QT3_SUPPORT
    00512     inline QT3_SUPPORT const char *ascii() const { return ascii_helper(); }
    00513     inline QT3_SUPPORT const char *latin1() const { return latin1_helper(); }
    00514     inline QT3_SUPPORT QByteArray utf8() const { return toUtf8(); }
    00515     inline QT3_SUPPORT QByteArray local8Bit() const{ return toLocal8Bit(); }
    00516     inline QT3_SUPPORT void setLength(int nl) { resize(nl); }
    00517     inline QT3_SUPPORT QString copy() const { return *this; }
    00518     inline QT3_SUPPORT QString &remove(QChar c, bool cs)
    00519     { return remove(c, cs?Qt::CaseSensitive:Qt::CaseInsensitive); }
    00520     inline QT3_SUPPORT QString &remove(const QString  &s, bool cs)
    00521     { return remove(s, cs?Qt::CaseSensitive:Qt::CaseInsensitive); }
    00522     inline QT3_SUPPORT QString &replace(QChar c, const QString  &after, bool cs)
    00523     { return replace(c, after, cs?Qt::CaseSensitive:Qt::CaseInsensitive); }
    00524     inline QT3_SUPPORT QString &replace(const QString &before, const QString &after, bool cs)
    00525     { return replace(before, after, cs?Qt::CaseSensitive:Qt::CaseInsensitive); }
    00526 #ifndef QT_NO_CAST_FROM_ASCII
    00527     inline QT3_SUPPORT QString &replace(char c, const QString &after, bool cs)
    00528     { return replace(QChar::fromAscii(c), after, cs ? Qt::CaseSensitive : Qt::CaseInsensitive); }
    00529     // strange overload, required to avoid GCC 3.3 error
    00530     inline QT3_SUPPORT QString &replace(char c, const QString &after, Qt::CaseSensitivity cs)
    00531     { return replace(QChar::fromAscii(c), after, cs ? Qt::CaseSensitive : Qt::CaseInsensitive); }
    00532 #endif
    00533     inline QT3_SUPPORT int find(QChar c, int i = 0, bool cs = true) const
    00534     { return indexOf(c, i, cs?Qt::CaseSensitive:Qt::CaseInsensitive); }
    00535     inline QT3_SUPPORT int find(const QString &s, int i = 0, bool cs = true) const
    00536     { return indexOf(s, i, cs?Qt::CaseSensitive:Qt::CaseInsensitive); }
    00537     inline QT3_SUPPORT int findRev(QChar c, int i = -1, bool cs = true) const
    00538     { return lastIndexOf(c, i, cs?Qt::CaseSensitive:Qt::CaseInsensitive); }
    00539     inline QT3_SUPPORT int findRev(const QString &s, int i = -1, bool cs = true) const
    00540     { return lastIndexOf(s, i, cs?Qt::CaseSensitive:Qt::CaseInsensitive); }
    00541 #ifndef QT_NO_REGEXP
    00542     inline QT3_SUPPORT int find(const QRegExp &rx, int i=0) const
    00543     { return indexOf(rx, i); }
    00544     inline QT3_SUPPORT int findRev(const QRegExp &rx, int i=-1) const
    00545     { return lastIndexOf(rx, i); }
    00546     inline QT3_SUPPORT int find(QRegExp &rx, int i=0) const
    00547     { return indexOf(rx, i); }
    00548     inline QT3_SUPPORT int findRev(QRegExp &rx, int i=-1) const
    00549     { return lastIndexOf(rx, i); }
    00550 #endif
    00551     inline QT3_SUPPORT QBool contains(QChar c, bool cs) const
    00552     { return contains(c, cs?Qt::CaseSensitive:Qt::CaseInsensitive); }
    00553     inline QT3_SUPPORT QBool contains(const QString &s, bool cs) const
    00554     { return contains(s, cs?Qt::CaseSensitive:Qt::CaseInsensitive); }
    00555     inline QT3_SUPPORT bool startsWith(const QString &s, bool cs) const
    00556     { return startsWith(s, cs?Qt::CaseSensitive:Qt::CaseInsensitive); }
    00557     inline QT3_SUPPORT bool endsWith(const QString &s, bool cs) const
    00558     { return endsWith(s, cs?Qt::CaseSensitive:Qt::CaseInsensitive); }
    00559     inline QT3_SUPPORT QChar constref(uint i) const
    00560     { return at(i); }
    00561     QT3_SUPPORT QChar &ref(uint i);
    00562     inline QT3_SUPPORT QString leftJustify(int width, QChar aFill = QLatin1Char(' '), bool trunc=false) const
    00563     { return leftJustified(width, aFill, trunc); }
    00564     inline QT3_SUPPORT QString rightJustify(int width, QChar aFill = QLatin1Char(' '), bool trunc=false) const
    00565     { return rightJustified(width, aFill, trunc); }
    00566     inline QT3_SUPPORT QString lower() const { return toLower(); }
    00567     inline QT3_SUPPORT QString upper() const { return toUpper(); }
    00568     inline QT3_SUPPORT QString stripWhiteSpace() const { return trimmed(); }
    00569     inline QT3_SUPPORT QString simplifyWhiteSpace() const { return simplified(); }
    00570     inline QT3_SUPPORT QString &setUnicodeCodes(const ushort *unicode_as_ushorts, int aSize)
    00571     { return setUtf16(unicode_as_ushorts, aSize); }
    00572     inline QT3_SUPPORT const ushort *ucs2() const { return utf16(); }
    00573     inline static QT3_SUPPORT QString fromUcs2(const ushort *unicode, int size = -1)
    00574     { return fromUtf16(unicode, size); }
    00575     inline QT3_SUPPORT QString &setAscii(const char *str, int len = -1)
    00576     { *this = fromAscii(str, len); return *this; }
    00577     inline QT3_SUPPORT QString &setLatin1(const char *str, int len = -1)
    00578     { *this = fromLatin1(str, len); return *this; }
    00579 protected:
    00580     friend class QObject;
    00581     const char *ascii_helper() const;
    00582     const char *latin1_helper() const;
    00583 public:
    00584 #ifndef QT_NO_CAST_TO_ASCII
    00585     inline QT3_SUPPORT operator const char *() const { return ascii_helper(); }
    00586 private:
    00587     QT3_SUPPORT operator QNoImplicitBoolCast() const;
    00588 public:
    00589 #endif
    00590 #endif
    00591
    00592     bool isSimpleText() const { if (!d->clean) updateProperties(); return d->simpletext; }
    00593     bool isRightToLeft() const;
    00594
    00595     QString(int size, Qt::Initialization);
    00596
    00597 private:
    00598 #if defined(QT_NO_CAST_FROM_ASCII) && !defined(Q_NO_DECLARED_NOT_DEFINED)
    00599     QString &operator+=(const char *s);
    00600     QString &operator+=(const QByteArray &s);
    00601     QString(const char *ch);
    00602     QString(const QByteArray &a);
    00603     QString &operator=(const char  *ch);
    00604     QString &operator=(const QByteArray &a);
    00605 #endif
    00606
    00607     struct Data {
    00608         QBasicAtomicInt ref;
    00609         int alloc, size;
    00610         ushort *data; // QT5: put that after the bit field to fill alignment gap; don't use sizeof any more then
    00611         ushort clean : 1;
    00612         ushort simpletext : 1;
    00613         ushort righttoleft : 1;
    00614         ushort asciiCache : 1;
    00615         ushort capacity : 1;
    00616         ushort reserved : 11;
    00617         // ### Qt5: try to ensure that "array" is aligned to 16 bytes on both 32- and 64-bit
    00618         ushort array[1];
    00619     };
    00620     static Data shared_null;
    00621     static Data shared_empty;
    00622     Data *d;
    00623     QString(Data *dd, int /*dummy*/) : d(dd) {}
    00624 #ifndef QT_NO_TEXTCODEC
    00625     static QTextCodec *codecForCStrings;
    00626 #endif
    00627     static int grow(int);
    00628     static void free(Data *);
    00629     void realloc();
    00630     void realloc(int alloc);
    00631     void expand(int i);
    00632     void updateProperties() const;
    00633     QString multiArg(int numArgs, const QString **args) const;
    00634     static int compare_helper(const QChar *data1, int length1,
    00635                               const QChar *data2, int length2,
    00636                               Qt::CaseSensitivity cs = Qt::CaseSensitive);
    00637     static int compare_helper(const QChar *data1, int length1,
    00638                               QLatin1String s2,
    00639                               Qt::CaseSensitivity cs = Qt::CaseSensitive);
    00640     static int localeAwareCompare_helper(const QChar *data1, int length1,
    00641                                          const QChar *data2, int length2);
    00642     static Data *fromLatin1_helper(const char *str, int size = -1);
    00643     static Data *fromAscii_helper(const char *str, int size = -1);
    00644     void replace_helper(uint *indices, int nIndices, int blen, const QChar *after, int alen);
    00645     friend class QCharRef;
    00646     friend class QTextCodec;
    00647     friend class QStringRef;
    00648     friend struct QAbstractConcatenable;
    00649     friend inline bool qStringComparisonHelper(const QString &s1, const char *s2);
    00650     friend inline bool qStringComparisonHelper(const QStringRef &s1, const char *s2);
    00651 public:
    00652     typedef Data * DataPtr;
    00653     inline DataPtr &data_ptr() { return d; }
    00654 };
    00655
    00656
    00657 class Q_CORE_EXPORT QLatin1String
    00658 {
    00659 public:
    00660     inline explicit QLatin1String(const char *s) : chars(s) {}
    00661     inline QLatin1String &operator=(const QLatin1String &other)
    00662     { chars = other.chars; return *this; }
    00663
    00664     inline const char *latin1() const { return chars; }
    00665
    00666     inline bool operator==(const QString &s) const
    00667     { return s == *this; }
    00668     inline bool operator!=(const QString &s) const
    00669     { return s != *this; }
    00670     inline bool operator>(const QString &s) const
    00671     { return s < *this; }
    00672     inline bool operator<(const QString &s) const
    00673     { return s > *this; }
    00674     inline bool operator>=(const QString &s) const
    00675     { return s <= *this; }
    00676     inline bool operator<=(const QString &s) const
    00677     { return s >= *this; }
    00678
    00679     inline QT_ASCII_CAST_WARN bool operator==(const char *s) const
    00680         { return QString::fromAscii(s) == *this; }
    00681     inline QT_ASCII_CAST_WARN bool operator!=(const char *s) const
    00682         { return QString::fromAscii(s) != *this; }
    00683     inline QT_ASCII_CAST_WARN bool operator<(const char *s) const
    00684         { return QString::fromAscii(s) > *this; }
    00685     inline QT_ASCII_CAST_WARN bool operator>(const char *s) const
    00686         { return QString::fromAscii(s) < *this; }
    00687     inline QT_ASCII_CAST_WARN bool operator<=(const char *s) const
    00688         { return QString::fromAscii(s) >= *this; }
    00689     inline QT_ASCII_CAST_WARN bool operator>=(const char *s) const
    00690         { return QString::fromAscii(s) <= *this; }
    00691 private:
    00692     const char *chars;
    00693 };
    00694
    00695
    00696
    00697 inline QString::QString(const QLatin1String &aLatin1) : d(fromLatin1_helper(aLatin1.latin1()))
    00698 { }
    00699 inline int QString::length() const
    00700 { return d->size; }
    00701 inline const QChar QString::at(int i) const
    00702 { Q_ASSERT(i >= 0 && i < size()); return d->data[i]; }
    00703 inline const QChar QString::operator[](int i) const
    00704 { Q_ASSERT(i >= 0 && i < size()); return d->data[i]; }
    00705 inline const QChar QString::operator[](uint i) const
    00706 { Q_ASSERT(i < uint(size())); return d->data[i]; }
    00707 inline bool QString::isEmpty() const
    00708 { return d->size == 0; }
    00709 inline const QChar *QString::unicode() const
    00710 { return reinterpret_cast<const QChar*>(d->data); }
    00711 inline const QChar *QString::data() const
    00712 { return reinterpret_cast<const QChar*>(d->data); }
    00713 inline QChar *QString::data()
    00714 { detach(); return reinterpret_cast<QChar*>(d->data); }
    00715 inline const QChar *QString::constData() const
    00716 { return reinterpret_cast<const QChar*>(d->data); }
    00717 inline void QString::detach()
    00718 { if (d->ref != 1 || d->data != d->array) realloc(); }
    00719 inline bool QString::isDetached() const
    00720 { return d->ref == 1; }
    00721 inline QString &QString::operator=(const QLatin1String &s)
    00722 {
    00723     *this = fromLatin1(s.latin1());
    00724     return *this;
    00725 }
    00726 inline void QString::clear()
    00727 { if (!isNull()) *this = QString(); }
    00728 inline QString::QString(const QString &other) : d(other.d)
    00729 { Q_ASSERT(&other != this); d->ref.ref(); }
    00730 inline int QString::capacity() const
    00731 { return d->alloc; }
    00732 inline QString &QString::setNum(short n, int base)
    00733 { return setNum(qlonglong(n), base); }
    00734 inline QString &QString::setNum(ushort n, int base)
    00735 { return setNum(qulonglong(n), base); }
    00736 inline QString &QString::setNum(int n, int base)
    00737 { return setNum(qlonglong(n), base); }
    00738 inline QString &QString::setNum(uint n, int base)
    00739 { return setNum(qulonglong(n), base); }
    00740 inline QString &QString::setNum(long n, int base)
    00741 { return setNum(qlonglong(n), base); }
    00742 inline QString &QString::setNum(ulong n, int base)
    00743 { return setNum(qulonglong(n), base); }
    00744 inline QString &QString::setNum(float n, char f, int prec)
    00745 { return setNum(double(n),f,prec); }
    00746 inline QString QString::arg(int a, int fieldWidth, int base, const QChar &fillChar) const
    00747 { return arg(qlonglong(a), fieldWidth, base, fillChar); }
    00748 inline QString QString::arg(uint a, int fieldWidth, int base, const QChar &fillChar) const
    00749 { return arg(qulonglong(a), fieldWidth, base, fillChar); }
    00750 inline QString QString::arg(long a, int fieldWidth, int base, const QChar &fillChar) const
    00751 { return arg(qlonglong(a), fieldWidth, base, fillChar); }
    00752 inline QString QString::arg(ulong a, int fieldWidth, int base, const QChar &fillChar) const
    00753 { return arg(qulonglong(a), fieldWidth, base, fillChar); }
    00754 inline QString QString::arg(short a, int fieldWidth, int base, const QChar &fillChar) const
    00755 { return arg(qlonglong(a), fieldWidth, base, fillChar); }
    00756 inline QString QString::arg(ushort a, int fieldWidth, int base, const QChar &fillChar) const
    00757 { return arg(qulonglong(a), fieldWidth, base, fillChar); }
    00758 inline QString QString::arg(const QString &a1, const QString &a2) const
    00759 { const QString *args[2] = { &a1, &a2 }; return multiArg(2, args); }
    00760 inline QString QString::arg(const QString &a1, const QString &a2, const QString &a3) const
    00761 { const QString *args[3] = { &a1, &a2, &a3 }; return multiArg(3, args); }
    00762 inline QString QString::arg(const QString &a1, const QString &a2, const QString &a3,
    00763                             const QString &a4) const
    00764 { const QString *args[4] = { &a1, &a2, &a3, &a4 }; return multiArg(4, args); }
    00765 inline QString QString::arg(const QString &a1, const QString &a2, const QString &a3,
    00766                             const QString &a4, const QString &a5) const
    00767 { const QString *args[5] = { &a1, &a2, &a3, &a4, &a5 }; return multiArg(5, args); }
    00768 inline QString QString::arg(const QString &a1, const QString &a2, const QString &a3,
    00769                             const QString &a4, const QString &a5, const QString &a6) const
    00770 { const QString *args[6] = { &a1, &a2, &a3, &a4, &a5, &a6 }; return multiArg(6, args); }
    00771 inline QString QString::arg(const QString &a1, const QString &a2, const QString &a3,
    00772                             const QString &a4, const QString &a5, const QString &a6,
    00773                             const QString &a7) const
    00774 { const QString *args[7] = { &a1, &a2, &a3, &a4, &a5, &a6,  &a7 }; return multiArg(7, args); }
    00775 inline QString QString::arg(const QString &a1, const QString &a2, const QString &a3,
    00776                             const QString &a4, const QString &a5, const QString &a6,
    00777                             const QString &a7, const QString &a8) const
    00778 { const QString *args[8] = { &a1, &a2, &a3, &a4, &a5, &a6,  &a7, &a8 }; return multiArg(8, args); }
    00779 inline QString QString::arg(const QString &a1, const QString &a2, const QString &a3,
    00780                             const QString &a4, const QString &a5, const QString &a6,
    00781                             const QString &a7, const QString &a8, const QString &a9) const
    00782 { const QString *args[9] = { &a1, &a2, &a3, &a4, &a5, &a6,  &a7, &a8, &a9 }; return multiArg(9, args); }
    00783
    00784 inline QString QString::section(QChar asep, int astart, int aend, SectionFlags aflags) const
    00785 { return section(QString(asep), astart, aend, aflags); }
    00786
    00787
    00788 class Q_CORE_EXPORT QCharRef {
    00789     QString &s;
    00790     int i;
    00791     inline QCharRef(QString &str, int idx)
    00792         : s(str),i(idx) {}
    00793     friend class QString;
    00794 public:
    00795
    00796     // most QChar operations repeated here
    00797
    00798     // all this is not documented: We just say "like QChar" and let it be.
    00799     inline operator QChar() const
    00800         { return i < s.d->size ? s.d->data[i] : 0; }
    00801     inline QCharRef &operator=(const QChar &c)
    00802         { if (i >= s.d->size) s.expand(i); else s.detach();
    00803           s.d->data[i] = c.unicode();  return *this; }
    00804
    00805     // An operator= for each QChar cast constructors
    00806 #ifndef QT_NO_CAST_FROM_ASCII
    00807     inline QT_ASCII_CAST_WARN QCharRef &operator=(char c)
    00808     { return operator=(QChar::fromAscii(c)); }
    00809     inline QT_ASCII_CAST_WARN QCharRef &operator=(uchar c)
    00810     { return operator=(QChar::fromAscii(c)); }
    00811 #endif
    00812     inline QCharRef &operator=(const QCharRef &c) { return operator=(QChar(c)); }
    00813     inline QCharRef &operator=(ushort rc) { return operator=(QChar(rc)); }
    00814     inline QCharRef &operator=(short rc) { return operator=(QChar(rc)); }
    00815     inline QCharRef &operator=(uint rc) { return operator=(QChar(rc)); }
    00816     inline QCharRef &operator=(int rc) { return operator=(QChar(rc)); }
    00817
    00818     // each function...
    00819     inline bool isNull() const { return QChar(*this).isNull(); }
    00820     inline bool isPrint() const { return QChar(*this).isPrint(); }
    00821     inline bool isPunct() const { return QChar(*this).isPunct(); }
    00822     inline bool isSpace() const { return QChar(*this).isSpace(); }
    00823     inline bool isMark() const { return QChar(*this).isMark(); }
    00824     inline bool isLetter() const { return QChar(*this).isLetter(); }
    00825     inline bool isNumber() const { return QChar(*this).isNumber(); }
    00826     inline bool isLetterOrNumber() { return QChar(*this).isLetterOrNumber(); }
    00827     inline bool isDigit() const { return QChar(*this).isDigit(); }
    00828     inline bool isLower() const { return QChar(*this).isLower(); }
    00829     inline bool isUpper() const { return QChar(*this).isUpper(); }
    00830     inline bool isTitleCase() const { return QChar(*this).isTitleCase(); }
    00831
    00832     inline int digitValue() const { return QChar(*this).digitValue(); }
    00833     QChar toLower() const { return QChar(*this).toLower(); }
    00834     QChar toUpper() const { return QChar(*this).toUpper(); }
    00835     QChar toTitleCase () const { return QChar(*this).toTitleCase(); }
    00836
    00837     QChar::Category category() const { return QChar(*this).category(); }
    00838     QChar::Direction direction() const { return QChar(*this).direction(); }
    00839     QChar::Joining joining() const { return QChar(*this).joining(); }
    00840     bool hasMirrored() const { return QChar(*this).hasMirrored(); }
    00841     QChar mirroredChar() const { return QChar(*this).mirroredChar(); }
    00842     QString decomposition() const { return QChar(*this).decomposition(); }
    00843     QChar::Decomposition decompositionTag() const { return QChar(*this).decompositionTag(); }
    00844     uchar combiningClass() const { return QChar(*this).combiningClass(); }
    00845
    00846     QChar::UnicodeVersion unicodeVersion() const { return QChar(*this).unicodeVersion(); }
    00847
    00848     inline uchar cell() const { return QChar(*this).cell(); }
    00849     inline uchar row() const { return QChar(*this).row(); }
    00850     inline void setCell(uchar cell);
    00851     inline void setRow(uchar row);
    00852
    00853 #ifdef Q_COMPILER_MANGLES_RETURN_TYPE
    00854     const char toAscii() const { return QChar(*this).toAscii(); }
    00855     const char toLatin1() const { return QChar(*this).toLatin1(); }
    00856     const ushort unicode() const { return QChar(*this).unicode(); }
    00857 #else
    00858     char toAscii() const { return QChar(*this).toAscii(); }
    00859     char toLatin1() const { return QChar(*this).toLatin1(); }
    00860     ushort unicode() const { return QChar(*this).unicode(); }
    00861 #endif
    00862     ushort& unicode() { return s.data()[i].unicode(); }
    00863
    00864 #ifdef QT3_SUPPORT
    00865     inline QT3_SUPPORT bool mirrored() const { return hasMirrored(); }
    00866     inline QT3_SUPPORT QChar lower() const { return QChar(*this).toLower(); }
    00867     inline QT3_SUPPORT QChar upper() const { return QChar(*this).toUpper(); }
    00868 #ifdef Q_COMPILER_MANGLES_RETURN_TYPE
    00869     const QT3_SUPPORT char latin1() const { return QChar(*this).toLatin1(); }
    00870     const QT3_SUPPORT char ascii() const { return QChar(*this).toAscii(); }
    00871 #else
    00872     QT3_SUPPORT char latin1() const { return QChar(*this).toLatin1(); }
    00873     QT3_SUPPORT char ascii() const { return QChar(*this).toAscii(); }
    00874 #endif
    00875 #endif
    00876 };
    00877
    00878 inline void QCharRef::setRow(uchar arow) { QChar(*this).setRow(arow); }
    00879 inline void QCharRef::setCell(uchar acell) { QChar(*this).setCell(acell); }
    00880
    00881
    00882 inline QString::QString() : d(&shared_null) { d->ref.ref(); }
    00883 inline QString::~QString() { if (!d->ref.deref()) free(d); }
    00884 inline void QString::reserve(int asize) { if (d->ref != 1 || asize > d->alloc) realloc(asize); d->capacity = 1;}
    00885 inline QString &QString::setUtf16(const ushort *autf16, int asize)
    00886 { return setUnicode(reinterpret_cast<const QChar *>(autf16), asize); }
    00887 inline QCharRef QString::operator[](int i)
    00888 { Q_ASSERT(i >= 0); return QCharRef(*this, i); }
    00889 inline QCharRef QString::operator[](uint i)
    00890 { return QCharRef(*this, i); }
    00891 inline QString::iterator QString::begin()
    00892 { detach(); return reinterpret_cast<QChar*>(d->data); }
    00893 inline QString::const_iterator QString::begin() const
    00894 { return reinterpret_cast<const QChar*>(d->data); }
    00895 inline QString::const_iterator QString::constBegin() const
    00896 { return reinterpret_cast<const QChar*>(d->data); }
    00897 inline QString::iterator QString::end()
    00898 { detach(); return reinterpret_cast<QChar*>(d->data + d->size); }
    00899 inline QString::const_iterator QString::end() const
    00900 { return reinterpret_cast<const QChar*>(d->data + d->size); }
    00901 inline QString::const_iterator QString::constEnd() const
    00902 { return reinterpret_cast<const QChar*>(d->data + d->size); }
    00903 inline QBool QString::contains(const QString &s, Qt::CaseSensitivity cs) const
    00904 { return QBool(indexOf(s, 0, cs) != -1); }
    00905 inline QBool QString::contains(QChar c, Qt::CaseSensitivity cs) const
    00906 { return QBool(indexOf(c, 0, cs) != -1); }
    00907
    00908
    00909 inline bool operator==(QString::Null, QString::Null) { return true; }
    00910 inline bool operator==(QString::Null, const QString &s) { return s.isNull(); }
    00911 inline bool operator==(const QString &s, QString::Null) { return s.isNull(); }
    00912 inline bool operator!=(QString::Null, QString::Null) { return false; }
    00913 inline bool operator!=(QString::Null, const QString &s) { return !s.isNull(); }
    00914 inline bool operator!=(const QString &s, QString::Null) { return !s.isNull(); }
    00915
    00916 #ifndef QT_NO_CAST_FROM_ASCII
    00917 inline bool qStringComparisonHelper(const QString &s1, const char *s2)
    00918 {
    00919 #  ifndef QT_NO_TEXTCODEC
    00920     if (QString::codecForCStrings) return (s1 == QString::fromAscii(s2));
    00921 #  endif
    00922     return (s1 == QLatin1String(s2));
    00923 }
    00924 inline bool QString::operator==(const char *s) const
    00925 { return qStringComparisonHelper(*this, s); }
    00926 inline bool QString::operator!=(const char *s) const
    00927 { return !qStringComparisonHelper(*this, s); }
    00928 inline bool QString::operator<(const char *s) const
    00929 { return *this < QString::fromAscii(s); }
    00930 inline bool QString::operator>(const char *s) const
    00931 { return *this > QString::fromAscii(s); }
    00932 inline bool QString::operator<=(const char *s) const
    00933 { return *this <= QString::fromAscii(s); }
    00934 inline bool QString::operator>=(const char *s) const
    00935 { return *this >= QString::fromAscii(s); }
    00936
    00937 inline QT_ASCII_CAST_WARN bool operator==(const char *s1, const QString &s2)
    00938 { return qStringComparisonHelper(s2, s1); }
    00939 inline QT_ASCII_CAST_WARN bool operator!=(const char *s1, const QString &s2)
    00940 { return !qStringComparisonHelper(s2, s1); }
    00941 inline QT_ASCII_CAST_WARN bool operator<(const char *s1, const QString &s2)
    00942 { return (QString::fromAscii(s1) < s2); }
    00943 inline QT_ASCII_CAST_WARN bool operator>(const char *s1, const QString &s2)
    00944 { return (QString::fromAscii(s1) > s2); }
    00945 inline QT_ASCII_CAST_WARN bool operator<=(const char *s1, const QString &s2)
    00946 { return (QString::fromAscii(s1) <= s2); }
    00947 inline QT_ASCII_CAST_WARN bool operator>=(const char *s1, const QString &s2)
    00948 { return (QString::fromAscii(s1) >= s2); }
    00949
    00950 inline QT_ASCII_CAST_WARN bool operator==(const char *s1, const QLatin1String &s2)
    00951 { return QString::fromAscii(s1) == s2; }
    00952 inline QT_ASCII_CAST_WARN bool operator!=(const char *s1, const QLatin1String &s2)
    00953 { return QString::fromAscii(s1) != s2; }
    00954 inline QT_ASCII_CAST_WARN bool operator<(const char *s1, const QLatin1String &s2)
    00955 { return (QString::fromAscii(s1) < s2); }
    00956 inline QT_ASCII_CAST_WARN bool operator>(const char *s1, const QLatin1String &s2)
    00957 { return (QString::fromAscii(s1) > s2); }
    00958 inline QT_ASCII_CAST_WARN bool operator<=(const char *s1, const QLatin1String &s2)
    00959 { return (QString::fromAscii(s1) <= s2); }
    00960 inline QT_ASCII_CAST_WARN bool operator>=(const char *s1, const QLatin1String &s2)
    00961 { return (QString::fromAscii(s1) >= s2); }
    00962
    00963 inline bool operator==(const QLatin1String &s1, const QLatin1String &s2)
    00964 { return (qstrcmp(s1.latin1(), s2.latin1()) == 0); }
    00965 inline bool operator!=(const QLatin1String &s1, const QLatin1String &s2)
    00966 { return (qstrcmp(s1.latin1(), s2.latin1()) != 0); }
    00967 inline bool operator<(const QLatin1String &s1, const QLatin1String &s2)
    00968 { return (qstrcmp(s1.latin1(), s2.latin1()) < 0); }
    00969 inline bool operator<=(const QLatin1String &s1, const QLatin1String &s2)
    00970 { return (qstrcmp(s1.latin1(), s2.latin1()) <= 0); }
    00971 inline bool operator>(const QLatin1String &s1, const QLatin1String &s2)
    00972 { return (qstrcmp(s1.latin1(), s2.latin1()) > 0); }
    00973 inline bool operator>=(const QLatin1String &s1, const QLatin1String &s2)
    00974 { return (qstrcmp(s1.latin1(), s2.latin1()) >= 0); }
    00975
    00976
    00977 inline bool QString::operator==(const QByteArray &s) const
    00978 { return qStringComparisonHelper(*this, s.constData()); }
    00979 inline bool QString::operator!=(const QByteArray &s) const
    00980 { return !qStringComparisonHelper(*this, s.constData()); }
    00981
    00982 inline bool QByteArray::operator==(const QString &s) const
    00983 { return qStringComparisonHelper(s, constData()); }
    00984 inline bool QByteArray::operator!=(const QString &s) const
    00985 { return !qStringComparisonHelper(s, constData()); }
    00986 inline bool QByteArray::operator<(const QString &s) const
    00987 { return QString::fromAscii(constData(), size()) < s; }
    00988 inline bool QByteArray::operator>(const QString &s) const
    00989 { return QString::fromAscii(constData(), size()) > s; }
    00990 inline bool QByteArray::operator<=(const QString &s) const
    00991 { return QString::fromAscii(constData(), size()) <= s; }
    00992 inline bool QByteArray::operator>=(const QString &s) const
    00993 { return QString::fromAscii(constData(), size()) >= s; }
    00994 #endif   // QT_NO_CAST_FROM_ASCII
    00995
    00996 #ifndef QT_NO_CAST_TO_ASCII
    00997 inline QByteArray &QByteArray::append(const QString &s)
    00998 { return append(s.toAscii()); }
    00999 inline QByteArray &QByteArray::insert(int i, const QString &s)
    01000 { return insert(i, s.toAscii()); }
    01001 inline QByteArray &QByteArray::replace(char c, const QString &after)
    01002 { return replace(c, after.toAscii()); }
    01003 inline QByteArray &QByteArray::replace(const QString &before, const char *after)
    01004 { return replace(before.toAscii(), after); }
    01005 inline QByteArray &QByteArray::replace(const QString &before, const QByteArray &after)
    01006 { return replace(before.toAscii(), after); }
    01007 inline QByteArray &QByteArray::operator+=(const QString &s)
    01008 { return operator+=(s.toAscii()); }
    01009 inline int QByteArray::indexOf(const QString &s, int from) const
    01010 { return indexOf(s.toAscii(), from); }
    01011 inline int QByteArray::lastIndexOf(const QString &s, int from) const
    01012 { return lastIndexOf(s.toAscii(), from); }
    01013 #  ifdef QT3_SUPPORT
    01014 inline int QByteArray::find(const QString &s, int from) const
    01015 { return indexOf(s.toAscii(), from); }
    01016 inline int QByteArray::findRev(const QString &s, int from) const
    01017 { return lastIndexOf(s.toAscii(), from); }
    01018 #  endif // QT3_SUPPORT
    01019 #endif // QT_NO_CAST_TO_ASCII
    01020
    01021 #ifndef QT_USE_FAST_OPERATOR_PLUS
    01022 # ifndef QT_USE_FAST_CONCATENATION
    01023 inline const QString operator+(const QString &s1, const QString &s2)
    01024 { QString t(s1); t += s2; return t; }
    01025 inline const QString operator+(const QString &s1, QChar s2)
    01026 { QString t(s1); t += s2; return t; }
    01027 inline const QString operator+(QChar s1, const QString &s2)
    01028 { QString t(s1); t += s2; return t; }
    01029 #  ifndef QT_NO_CAST_FROM_ASCII
    01030 inline QT_ASCII_CAST_WARN const QString operator+(const QString &s1, const char *s2)
    01031 { QString t(s1); t += QString::fromAscii(s2); return t; }
    01032 inline QT_ASCII_CAST_WARN const QString operator+(const char *s1, const QString &s2)
    01033 { QString t = QString::fromAscii(s1); t += s2; return t; }
    01034 inline QT_ASCII_CAST_WARN const QString operator+(char c, const QString &s)
    01035 { QString t = s; t.prepend(QChar::fromAscii(c)); return t; }
    01036 inline QT_ASCII_CAST_WARN const QString operator+(const QString &s, char c)
    01037 { QString t = s; t += QChar::fromAscii(c); return t; }
    01038 inline QT_ASCII_CAST_WARN const QString operator+(const QByteArray &ba, const QString &s)
    01039 { QString t = QString::fromAscii(ba.constData(), qstrnlen(ba.constData(), ba.size())); t += s; return t; }
    01040 inline QT_ASCII_CAST_WARN const QString operator+(const QString &s, const QByteArray &ba)
    01041 { QString t(s); t += QString::fromAscii(ba.constData(), qstrnlen(ba.constData(), ba.size())); return t; }
    01042 #  endif // QT_NO_CAST_FROM_ASCII
    01043 # endif // QT_USE_FAST_CONCATENATION
    01044 #endif // QT_USE_FAST_OPERATOR_PLUS
    01045
    01046 #ifndef QT_NO_STL
    01047 inline std::string QString::toStdString() const
    01048 { const QByteArray asc = toAscii(); return std::string(asc.constData(), asc.length()); }
    01049
    01050 inline QString QString::fromStdString(const std::string &s)
    01051 { return fromAscii(s.data(), int(s.size())); }
    01052
    01053 # ifndef QT_NO_STL_WCHAR
    01054 inline QStdWString QString::toStdWString() const
    01055 {
    01056     QStdWString str;
    01057     str.resize(length());
    01058
    01059 #if defined(_MSC_VER) && _MSC_VER >= 1400
    01060     // VS2005 crashes if the string is empty
    01061     if (!length())
    01062         return str;
    01063 #endif
    01064
    01065     str.resize(toWCharArray(&(*str.begin())));
    01066     return str;
    01067 }
    01068 inline QString QString::fromStdWString(const QStdWString &s)
    01069 { return fromWCharArray(s.data(), int(s.size())); }
    01070 # endif
    01071 #endif
    01072
    01073 #ifdef QT3_SUPPORT
    01074 inline QChar &QString::ref(uint i)
    01075 {
    01076     if (int(i) > d->size || d->ref != 1)
    01077         resize(qMax(int(i), d->size));
    01078     return reinterpret_cast<QChar&>(d->data[i]);
    01079 }
    01080 #endif
    01081
    01082 #if !defined(QT_NO_DATASTREAM) || (defined(QT_BOOTSTRAPPED) && !defined(QT_BUILD_QMAKE))
    01083 Q_CORE_EXPORT QDataStream &operator<<(QDataStream &, const QString &);
    01084 Q_CORE_EXPORT QDataStream &operator>>(QDataStream &, QString &);
    01085 #endif
    01086
    01087 #ifdef QT3_SUPPORT
    01088 class QConstString : public QString
    01089 {
    01090 public:
    01091     inline QT3_SUPPORT_CONSTRUCTOR QConstString(const QChar *aUnicode, int aSize)
    01092         :QString(aUnicode, aSize){} // cannot use fromRawData() due to changed semantics
    01093     inline QT3_SUPPORT const QString &string() const { return *this; }
    01094 };
    01095 #endif
    01096
    01097 Q_DECLARE_TYPEINFO(QString, Q_MOVABLE_TYPE);
    01098 Q_DECLARE_SHARED(QString)
    01099 Q_DECLARE_OPERATORS_FOR_FLAGS(QString::SectionFlags)
    01100
    01101
    01102 class Q_CORE_EXPORT QStringRef {
    01103     const QString *m_string;
    01104     int m_position;
    01105     int m_size;
    01106 public:
    01107     inline QStringRef():m_string(0), m_position(0), m_size(0){}
    01108     inline QStringRef(const QString *string, int position, int size);
    01109     inline QStringRef(const QString *string);
    01110     inline QStringRef(const QStringRef &other)
    01111         :m_string(other.m_string), m_position(other.m_position), m_size(other.m_size)
    01112         {}
    01113
    01114     inline ~QStringRef(){}
    01115     inline const QString *string() const { return m_string; }
    01116     inline int position() const { return m_position; }
    01117     inline int size() const { return m_size; }
    01118     inline int count() const { return m_size; }
    01119     inline int length() const { return m_size; }
    01120
    01121     inline QStringRef &operator=(const QStringRef &other) {
    01122         m_string = other.m_string; m_position = other.m_position;
    01123         m_size = other.m_size; return *this;
    01124     }
    01125
    01126     inline QStringRef &operator=(const QString *string);
    01127
    01128     inline const QChar *unicode() const {
    01129         if (!m_string)
    01130             return reinterpret_cast<const QChar *>(QString::shared_null.data);
    01131         return m_string->unicode() + m_position;
    01132     }
    01133     inline const QChar *data() const { return unicode(); }
    01134     inline const QChar *constData() const {  return unicode(); }
    01135
    01136     inline void clear() { m_string = 0; m_position = m_size = 0; }
    01137     QString toString() const;
    01138     inline bool isEmpty() const { return m_size == 0; }
    01139     inline bool isNull() const { return m_string == 0 || m_string->isNull(); }
    01140
    01141     QStringRef appendTo(QString *string) const;
    01142
    01143     inline const QChar at(int i) const
    01144         { Q_ASSERT(i >= 0 && i < size()); return m_string->at(i + m_position); }
    01145
    01146     int compare(const QString &s, Qt::CaseSensitivity cs = Qt::CaseSensitive) const;
    01147     int compare(const QStringRef &s, Qt::CaseSensitivity cs = Qt::CaseSensitive) const;
    01148     int compare(QLatin1String s, Qt::CaseSensitivity cs = Qt::CaseSensitive) const;
    01149     static int compare(const QStringRef &s1, const QString &s2,
    01150                        Qt::CaseSensitivity = Qt::CaseSensitive);
    01151     static int compare(const QStringRef &s1, const QStringRef &s2,
    01152                        Qt::CaseSensitivity = Qt::CaseSensitive);
    01153     static int compare(const QStringRef &s1, QLatin1String s2,
    01154                        Qt::CaseSensitivity cs = Qt::CaseSensitive);
    01155
    01156     int localeAwareCompare(const QString &s) const;
    01157     int localeAwareCompare(const QStringRef &s) const;
    01158     static int localeAwareCompare(const QStringRef &s1, const QString &s2);
    01159     static int localeAwareCompare(const QStringRef &s1, const QStringRef &s2);
    01160 };
    01161
    01162 inline QStringRef &QStringRef::operator=(const QString *aString)
    01163 { m_string = aString; m_position = 0; m_size = aString?aString->size():0; return *this; }
    01164
    01165 inline QStringRef::QStringRef(const QString *aString, int aPosition, int aSize)
    01166         :m_string(aString), m_position(aPosition), m_size(aSize){}
    01167
    01168 inline QStringRef::QStringRef(const QString *aString)
    01169     :m_string(aString), m_position(0), m_size(aString?aString->size() : 0){}
    01170
    01171 Q_CORE_EXPORT bool operator==(const QStringRef &s1,const QStringRef &s2);
    01172 inline bool operator!=(const QStringRef &s1,const QStringRef &s2)
    01173 { return !(s1 == s2); }
    01174 Q_CORE_EXPORT bool operator==(const QString &s1,const QStringRef &s2);
    01175 inline bool operator!=(const QString &s1,const QStringRef &s2)
    01176 { return !(s1 == s2); }
    01177 inline bool operator==(const QStringRef &s1,const QString &s2)
    01178 { return s2 == s1; }
    01179 inline bool operator!=(const QStringRef &s1,const QString &s2)
    01180 { return s2 != s1; }
    01181 Q_CORE_EXPORT bool operator==(const QLatin1String &s1, const QStringRef &s2);
    01182 inline bool operator!=(const QLatin1String &s1,const QStringRef &s2)
    01183 { return !(s1 == s2); }
    01184 inline bool operator==(const QStringRef &s1,const QLatin1String &s2)
    01185 { return s2 == s1; }
    01186 inline bool operator!=(const QStringRef &s1,const QLatin1String &s2)
    01187 { return s2 != s1; }
    01188
    01189 Q_CORE_EXPORT bool operator<(const QStringRef &s1,const QStringRef &s2);
    01190 inline bool operator>(const QStringRef &s1, const QStringRef &s2)
    01191 { return s2 < s1; }
    01192 inline bool operator<=(const QStringRef &s1, const QStringRef &s2)
    01193 { return !(s1 > s2); }
    01194 inline bool operator>=(const QStringRef &s1, const QStringRef &s2)
    01195 { return !(s1 < s2); }
    01196
    01197 inline bool qStringComparisonHelper(const QStringRef &s1, const char *s2)
    01198 {
    01199 #  ifndef QT_NO_TEXTCODEC
    01200     if (QString::codecForCStrings) return (s1 == QString::fromAscii(s2));
    01201 #  endif
    01202     return (s1 == QLatin1String(s2));
    01203 }
    01204
    01205 inline QT_ASCII_CAST_WARN bool operator==(const char *s1, const QStringRef &s2)
    01206 { return qStringComparisonHelper(s2, s1); }
    01207 inline QT_ASCII_CAST_WARN bool operator==(const QStringRef &s1, const char *s2)
    01208 { return qStringComparisonHelper(s1, s2); }
    01209 inline QT_ASCII_CAST_WARN bool operator!=(const char *s1, const QStringRef &s2)
    01210 { return !qStringComparisonHelper(s2, s1); }
    01211 inline QT_ASCII_CAST_WARN bool operator!=(const QStringRef &s1, const char *s2)
    01212 { return !qStringComparisonHelper(s1, s2); }
    01213
    01214 inline int QString::compare(const QStringRef &s, Qt::CaseSensitivity cs) const
    01215 { return QString::compare_helper(constData(), length(), s.constData(), s.length(), cs); }
    01216 inline int QString::compare(const QString &s1, const QStringRef &s2, Qt::CaseSensitivity cs)
    01217 { return QString::compare_helper(s1.constData(), s1.length(), s2.constData(), s2.length(), cs); }
    01218 inline int QStringRef::compare(const QString &s, Qt::CaseSensitivity cs) const
    01219 { return QString::compare_helper(constData(), length(), s.constData(), s.length(), cs); }
    01220 inline int QStringRef::compare(const QStringRef &s, Qt::CaseSensitivity cs) const
    01221 { return QString::compare_helper(constData(), length(), s.constData(), s.length(), cs); }
    01222 inline int QStringRef::compare(QLatin1String s, Qt::CaseSensitivity cs) const
    01223 { return QString::compare_helper(constData(), length(), s, cs); }
    01224 inline int QStringRef::compare(const QStringRef &s1, const QString &s2, Qt::CaseSensitivity cs)
    01225 { return QString::compare_helper(s1.constData(), s1.length(), s2.constData(), s2.length(), cs); }
    01226 inline int QStringRef::compare(const QStringRef &s1, const QStringRef &s2, Qt::CaseSensitivity cs)
    01227 { return QString::compare_helper(s1.constData(), s1.length(), s2.constData(), s2.length(), cs); }
    01228 inline int QStringRef::compare(const QStringRef &s1, QLatin1String s2, Qt::CaseSensitivity cs)
    01229 { return QString::compare_helper(s1.constData(), s1.length(), s2, cs); }
    01230
    01231 inline int QString::localeAwareCompare(const QStringRef &s) const
    01232 { return localeAwareCompare_helper(constData(), length(), s.constData(), s.length()); }
    01233 inline int QString::localeAwareCompare(const QString& s1, const QStringRef& s2)
    01234 { return localeAwareCompare_helper(s1.constData(), s1.length(), s2.constData(), s2.length()); }
    01235 inline int QStringRef::localeAwareCompare(const QString &s) const
    01236 { return QString::localeAwareCompare_helper(constData(), length(), s.constData(), s.length()); }
    01237 inline int QStringRef::localeAwareCompare(const QStringRef &s) const
    01238 { return QString::localeAwareCompare_helper(constData(), length(), s.constData(), s.length()); }
    01239 inline int QStringRef::localeAwareCompare(const QStringRef &s1, const QString &s2)
    01240 { return QString::localeAwareCompare_helper(s1.constData(), s1.length(), s2.constData(), s2.length()); }
    01241 inline int QStringRef::localeAwareCompare(const QStringRef &s1, const QStringRef &s2)
    01242 { return QString::localeAwareCompare_helper(s1.constData(), s1.length(), s2.constData(), s2.length()); }
    01243
    01244
    01245 QT_END_NAMESPACE
    01246
    01247 QT_END_HEADER
    01248
    01249 #ifdef QT_USE_FAST_CONCATENATION
    01250 #include <QtCore/qstringbuilder.h>
    01251 #endif
    01252
    01253 #endif // QSTRING_H