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

- File List
- File Members

Classes | Typedefs | Functions

# qstring.h File Reference

`#include <QtCore/qchar.h>`
`#include <QtCore/qbytearray.h>`
`#include <QtCore/qatomic.h>`
`#include <QtCore/qnamespace.h>`
`#include <string>`
`#include <stdarg.h>`

Go to the source code of this file.

## Classes
class | QString
struct | QString::Null
struct | QString::Data
class | QLatin1String
class | QCharRef
class | QStringRef
## Typedefs
typedef std::basic_string < wchar_t > | QStdWString
## Functions
bool | operator== (QString::Null, QString::Null)
bool | operator== (QString::Null, const QString &s)
bool | operator== (const QString &s, QString::Null)
bool | operator!= (QString::Null, QString::Null)
bool | operator!= (QString::Null, const QString &s)
bool | operator!= (const QString &s, QString::Null)
bool | qStringComparisonHelper (const QString &s1, const char *s2)
QT_ASCII_CAST_WARN bool | operator== (const char *s1, const QString &s2)
QT_ASCII_CAST_WARN bool | operator!= (const char *s1, const QString &s2)
QT_ASCII_CAST_WARN bool | operator< (const char *s1, const QString &s2)
QT_ASCII_CAST_WARN bool | operator> (const char *s1, const QString &s2)
QT_ASCII_CAST_WARN bool | operator<= (const char *s1, const QString &s2)
QT_ASCII_CAST_WARN bool | operator>= (const char *s1, const QString &s2)
QT_ASCII_CAST_WARN bool | operator== (const char *s1, const QLatin1String &s2)
QT_ASCII_CAST_WARN bool | operator!= (const char *s1, const QLatin1String &s2)
QT_ASCII_CAST_WARN bool | operator< (const char *s1, const QLatin1String &s2)
QT_ASCII_CAST_WARN bool | operator> (const char *s1, const QLatin1String &s2)
QT_ASCII_CAST_WARN bool | operator<= (const char *s1, const QLatin1String &s2)
QT_ASCII_CAST_WARN bool | operator>= (const char *s1, const QLatin1String &s2)
bool | operator== (const QLatin1String &s1, const QLatin1String &s2)
bool | operator!= (const QLatin1String &s1, const QLatin1String &s2)
bool | operator< (const QLatin1String &s1, const QLatin1String &s2)
bool | operator<= (const QLatin1String &s1, const QLatin1String &s2)
bool | operator> (const QLatin1String &s1, const QLatin1String &s2)
bool | operator>= (const QLatin1String &s1, const QLatin1String &s2)
const QString | operator+ (const QString &s1, const QString &s2)
const QString | operator+ (const QString &s1, QChar s2)
const QString | operator+ (QChar s1, const QString &s2)
QT_ASCII_CAST_WARN const QString | operator+ (const QString &s1, const char *s2)
QT_ASCII_CAST_WARN const QString | operator+ (const char *s1, const QString &s2)
QT_ASCII_CAST_WARN const QString | operator+ (char c, const QString &s)
QT_ASCII_CAST_WARN const QString | operator+ (const QString &s, char c)
QT_ASCII_CAST_WARN const QString | operator+ (const QByteArray &ba, const QString &s)
QT_ASCII_CAST_WARN const QString | operator+ (const QString &s, const QByteArray &ba)
Q_CORE_EXPORT QDataStream & | operator<< (QDataStream &, const QString &)
Q_CORE_EXPORT QDataStream & | operator>> (QDataStream &, QString &)
| Q_DECLARE_TYPEINFO (QString, Q_MOVABLE_TYPE)
Q_CORE_EXPORT bool | operator== (const QStringRef &s1, const QStringRef &s2)
bool | operator!= (const QStringRef &s1, const QStringRef &s2)
Q_CORE_EXPORT bool | operator== (const QString &s1, const QStringRef &s2)
bool | operator!= (const QString &s1, const QStringRef &s2)
bool | operator== (const QStringRef &s1, const QString &s2)
bool | operator!= (const QStringRef &s1, const QString &s2)
Q_CORE_EXPORT bool | operator== (const QLatin1String &s1, const QStringRef &s2)
bool | operator!= (const QLatin1String &s1, const QStringRef &s2)
bool | operator== (const QStringRef &s1, const QLatin1String &s2)
bool | operator!= (const QStringRef &s1, const QLatin1String &s2)
Q_CORE_EXPORT bool | operator< (const QStringRef &s1, const QStringRef &s2)
bool | operator> (const QStringRef &s1, const QStringRef &s2)
bool | operator<= (const QStringRef &s1, const QStringRef &s2)
bool | operator>= (const QStringRef &s1, const QStringRef &s2)
bool | qStringComparisonHelper (const QStringRef &s1, const char *s2)
QT_ASCII_CAST_WARN bool | operator== (const char *s1, const QStringRef &s2)
QT_ASCII_CAST_WARN bool | operator== (const QStringRef &s1, const char *s2)
QT_ASCII_CAST_WARN bool | operator!= (const char *s1, const QStringRef &s2)
QT_ASCII_CAST_WARN bool | operator!= (const QStringRef &s1, const char *s2)

## Typedef Documentation

typedef std::basic_string<wchar_t> QStdWString

Search for all occurrences

Definition at line 65 of file qstring.h.

## Function Documentation

bool operator== | ( | QString::Null | ,
|  | QString::Null |
| ) |  | `[inline]`

Definition at line 909 of file qstring.h.

    { return true; }

bool operator== | ( | QString::Null | ,
|  | const QString & | s
| ) |  | `[inline]`

Definition at line 910 of file qstring.h.

    { return s.isNull(); }

bool operator== | ( | const QString & | s,
|  | QString::Null |
| ) |  | `[inline]`

Definition at line 911 of file qstring.h.

    { return s.isNull(); }

bool operator!= | ( | QString::Null | ,
|  | QString::Null |
| ) |  | `[inline]`

Definition at line 912 of file qstring.h.

    { return false; }

bool operator!= | ( | QString::Null | ,
|  | const QString & | s
| ) |  | `[inline]`

Definition at line 913 of file qstring.h.

    { return !s.isNull(); }

bool operator!= | ( | const QString & | s,
|  | QString::Null |
| ) |  | `[inline]`

Definition at line 914 of file qstring.h.

    { return !s.isNull(); }

bool qStringComparisonHelper | ( | const QString & | s1,
|  | const char * | s2
| ) |  | `[inline]`

Search for all occurrences

Definition at line 917 of file qstring.h.

    {
    #  ifndef QT_NO_TEXTCODEC
        if (QString::codecForCStrings) return (s1 == QString::fromAscii(s2));
    #  endif
        return (s1 == QLatin1String(s2));
    }

QT_ASCII_CAST_WARN bool operator== | ( | const char * | s1,
|  | const QString & | s2
| ) |  | `[inline]`

Definition at line 937 of file qstring.h.

    { return qStringComparisonHelper(s2, s1); }

QT_ASCII_CAST_WARN bool operator!= | ( | const char * | s1,
|  | const QString & | s2
| ) |  | `[inline]`

Definition at line 939 of file qstring.h.

    { return !qStringComparisonHelper(s2, s1); }

QT_ASCII_CAST_WARN bool operator< | ( | const char * | s1,
|  | const QString & | s2
| ) |  | `[inline]`

Definition at line 941 of file qstring.h.

    { return (QString::fromAscii(s1) < s2); }

QT_ASCII_CAST_WARN bool operator> | ( | const char * | s1,
|  | const QString & | s2
| ) |  | `[inline]`

Definition at line 943 of file qstring.h.

    { return (QString::fromAscii(s1) > s2); }

QT_ASCII_CAST_WARN bool operator<= | ( | const char * | s1,
|  | const QString & | s2
| ) |  | `[inline]`

Definition at line 945 of file qstring.h.

    { return (QString::fromAscii(s1) <= s2); }

QT_ASCII_CAST_WARN bool operator>= | ( | const char * | s1,
|  | const QString & | s2
| ) |  | `[inline]`

Definition at line 947 of file qstring.h.

    { return (QString::fromAscii(s1) >= s2); }

QT_ASCII_CAST_WARN bool operator== | ( | const char * | s1,
|  | const QLatin1String & | s2
| ) |  | `[inline]`

Definition at line 950 of file qstring.h.

    { return QString::fromAscii(s1) == s2; }

QT_ASCII_CAST_WARN bool operator!= | ( | const char * | s1,
|  | const QLatin1String & | s2
| ) |  | `[inline]`

Definition at line 952 of file qstring.h.

    { return QString::fromAscii(s1) != s2; }

QT_ASCII_CAST_WARN bool operator< | ( | const char * | s1,
|  | const QLatin1String & | s2
| ) |  | `[inline]`

Definition at line 954 of file qstring.h.

    { return (QString::fromAscii(s1) < s2); }

QT_ASCII_CAST_WARN bool operator> | ( | const char * | s1,
|  | const QLatin1String & | s2
| ) |  | `[inline]`

Definition at line 956 of file qstring.h.

    { return (QString::fromAscii(s1) > s2); }

QT_ASCII_CAST_WARN bool operator<= | ( | const char * | s1,
|  | const QLatin1String & | s2
| ) |  | `[inline]`

Definition at line 958 of file qstring.h.

    { return (QString::fromAscii(s1) <= s2); }

QT_ASCII_CAST_WARN bool operator>= | ( | const char * | s1,
|  | const QLatin1String & | s2
| ) |  | `[inline]`

Definition at line 960 of file qstring.h.

    { return (QString::fromAscii(s1) >= s2); }

bool operator== | ( | const QLatin1String & | s1,
|  | const QLatin1String & | s2
| ) |  | `[inline]`

Definition at line 963 of file qstring.h.

    { return (qstrcmp(s1.latin1(), s2.latin1()) == 0); }

bool operator!= | ( | const QLatin1String & | s1,
|  | const QLatin1String & | s2
| ) |  | `[inline]`

Definition at line 965 of file qstring.h.

    { return (qstrcmp(s1.latin1(), s2.latin1()) != 0); }

bool operator< | ( | const QLatin1String & | s1,
|  | const QLatin1String & | s2
| ) |  | `[inline]`

Definition at line 967 of file qstring.h.

    { return (qstrcmp(s1.latin1(), s2.latin1()) < 0); }

bool operator<= | ( | const QLatin1String & | s1,
|  | const QLatin1String & | s2
| ) |  | `[inline]`

Definition at line 969 of file qstring.h.

    { return (qstrcmp(s1.latin1(), s2.latin1()) <= 0); }

bool operator> | ( | const QLatin1String & | s1,
|  | const QLatin1String & | s2
| ) |  | `[inline]`

Definition at line 971 of file qstring.h.

    { return (qstrcmp(s1.latin1(), s2.latin1()) > 0); }

bool operator>= | ( | const QLatin1String & | s1,
|  | const QLatin1String & | s2
| ) |  | `[inline]`

Definition at line 973 of file qstring.h.

    { return (qstrcmp(s1.latin1(), s2.latin1()) >= 0); }

const QString operator+ | ( | const QString & | s1,
|  | const QString & | s2
| ) |  | `[inline]`

Definition at line 1023 of file qstring.h.

    { QString t(s1); t += s2; return t; }

const QString operator+ | ( | const QString & | s1,
|  | QChar | s2
| ) |  | `[inline]`

Definition at line 1025 of file qstring.h.

    { QString t(s1); t += s2; return t; }

const QString operator+ | ( | QChar | s1,
|  | const QString & | s2
| ) |  | `[inline]`

Definition at line 1027 of file qstring.h.

    { QString t(s1); t += s2; return t; }

QT_ASCII_CAST_WARN const QString operator+ | ( | const QString & | s1,
|  | const char * | s2
| ) |  | `[inline]`

Definition at line 1030 of file qstring.h.

    { QString t(s1); t += QString::fromAscii(s2); return t; }

QT_ASCII_CAST_WARN const QString operator+ | ( | const char * | s1,
|  | const QString & | s2
| ) |  | `[inline]`

Definition at line 1032 of file qstring.h.

    { QString t = QString::fromAscii(s1); t += s2; return t; }

QT_ASCII_CAST_WARN const QString operator+ | ( | char | c,
|  | const QString & | s
| ) |  | `[inline]`

Definition at line 1034 of file qstring.h.

    { QString t = s; t.prepend(QChar::fromAscii(c)); return t; }

QT_ASCII_CAST_WARN const QString operator+ | ( | const QString & | s,
|  | char | c
| ) |  | `[inline]`

Definition at line 1036 of file qstring.h.

    { QString t = s; t += QChar::fromAscii(c); return t; }

QT_ASCII_CAST_WARN const QString operator+ | ( | const QByteArray & | ba,
|  | const QString & | s
| ) |  | `[inline]`

Definition at line 1038 of file qstring.h.

    { QString t = QString::fromAscii(ba.constData(), qstrnlen(ba.constData(), ba.size())); t += s; return t; }

QT_ASCII_CAST_WARN const QString operator+ | ( | const QString & | s,
|  | const QByteArray & | ba
| ) |  | `[inline]`

Definition at line 1040 of file qstring.h.

    { QString t(s); t += QString::fromAscii(ba.constData(), qstrnlen(ba.constData(), ba.size())); return t; }

Q_CORE_EXPORT QDataStream& operator<< | ( | QDataStream & | ,
|  | const QString & |
| ) |  |

Q_CORE_EXPORT QDataStream& operator>> | ( | QDataStream & | ,
|  | QString & |
| ) |  |

Q_DECLARE_TYPEINFO | ( | QString | ,
|  | Q_MOVABLE_TYPE |
| ) |  |

Search for all occurrences

Q_CORE_EXPORT bool operator== | ( | const QStringRef & | s1,
|  | const QStringRef & | s2
| ) |  |

bool operator!= | ( | const QStringRef & | s1,
|  | const QStringRef & | s2
| ) |  | `[inline]`

Definition at line 1172 of file qstring.h.

    { return !(s1 == s2); }

Q_CORE_EXPORT bool operator== | ( | const QString & | s1,
|  | const QStringRef & | s2
| ) |  |

bool operator!= | ( | const QString & | s1,
|  | const QStringRef & | s2
| ) |  | `[inline]`

Definition at line 1175 of file qstring.h.

    { return !(s1 == s2); }

bool operator== | ( | const QStringRef & | s1,
|  | const QString & | s2
| ) |  | `[inline]`

Definition at line 1177 of file qstring.h.

    { return s2 == s1; }

bool operator!= | ( | const QStringRef & | s1,
|  | const QString & | s2
| ) |  | `[inline]`

Definition at line 1179 of file qstring.h.

    { return s2 != s1; }

Q_CORE_EXPORT bool operator== | ( | const QLatin1String & | s1,
|  | const QStringRef & | s2
| ) |  |

bool operator!= | ( | const QLatin1String & | s1,
|  | const QStringRef & | s2
| ) |  | `[inline]`

Definition at line 1182 of file qstring.h.

    { return !(s1 == s2); }

bool operator== | ( | const QStringRef & | s1,
|  | const QLatin1String & | s2
| ) |  | `[inline]`

Definition at line 1184 of file qstring.h.

    { return s2 == s1; }

bool operator!= | ( | const QStringRef & | s1,
|  | const QLatin1String & | s2
| ) |  | `[inline]`

Definition at line 1186 of file qstring.h.

    { return s2 != s1; }

Q_CORE_EXPORT bool operator< | ( | const QStringRef & | s1,
|  | const QStringRef & | s2
| ) |  |

bool operator> | ( | const QStringRef & | s1,
|  | const QStringRef & | s2
| ) |  | `[inline]`

Definition at line 1190 of file qstring.h.

    { return s2 < s1; }

bool operator<= | ( | const QStringRef & | s1,
|  | const QStringRef & | s2
| ) |  | `[inline]`

Definition at line 1192 of file qstring.h.

    { return !(s1 > s2); }

bool operator>= | ( | const QStringRef & | s1,
|  | const QStringRef & | s2
| ) |  | `[inline]`

Definition at line 1194 of file qstring.h.

    { return !(s1 < s2); }

bool qStringComparisonHelper | ( | const QStringRef & | s1,
|  | const char * | s2
| ) |  | `[inline]`

Search for all occurrences

Definition at line 1197 of file qstring.h.

    {
    #  ifndef QT_NO_TEXTCODEC
        if (QString::codecForCStrings) return (s1 == QString::fromAscii(s2));
    #  endif
        return (s1 == QLatin1String(s2));
    }

QT_ASCII_CAST_WARN bool operator== | ( | const char * | s1,
|  | const QStringRef & | s2
| ) |  | `[inline]`

Definition at line 1205 of file qstring.h.

    { return qStringComparisonHelper(s2, s1); }

QT_ASCII_CAST_WARN bool operator== | ( | const QStringRef & | s1,
|  | const char * | s2
| ) |  | `[inline]`

Definition at line 1207 of file qstring.h.

    { return qStringComparisonHelper(s1, s2); }

QT_ASCII_CAST_WARN bool operator!= | ( | const char * | s1,
|  | const QStringRef & | s2
| ) |  | `[inline]`

Definition at line 1209 of file qstring.h.

    { return !qStringComparisonHelper(s2, s1); }

QT_ASCII_CAST_WARN bool operator!= | ( | const QStringRef & | s1,
|  | const char * | s2
| ) |  | `[inline]`

Definition at line 1211 of file qstring.h.

    { return !qStringComparisonHelper(s1, s2); }