Qt
Internal/Contributor docs for the Qt SDK. Note: These are NOT official API docs; those are found at https://doc.qt.io/
Loading...
Searching...
No Matches
qstring.h File Reference

(0a1c69bba5b5dd26b937ac0a67ab0bdd1c32b221)

#include <QtCore/qchar.h>
#include <QtCore/qcompare.h>
#include <QtCore/qbytearray.h>
#include <QtCore/qbytearrayview.h>
#include <QtCore/qarraydata.h>
#include <QtCore/qarraydatapointer.h>
#include <QtCore/qlatin1stringview.h>
#include <QtCore/qnamespace.h>
#include <QtCore/qstringalgorithms.h>
#include <QtCore/qanystringview.h>
#include <QtCore/qstringtokenizer.h>
#include <string>
#include <iterator>
#include <QtCore/q20memory.h>
#include <string_view>
#include <QtCore/q23type_traits.h>
#include <stdarg.h>
#include <QtCore/qstringbuilder.h>
#include <QtCore/qstringconverter.h>
Include dependency graph for qstring.h:

Go to the source code of this file.

Classes

struct  QtPrivate::treat_as_integral_arg< T >
struct  QtPrivate::treat_as_integral_arg< unsigned short >
struct  QtPrivate::treat_as_integral_arg< signed short >
struct  QtPrivate::treat_as_integral_arg< unsigned char >
struct  QtPrivate::treat_as_integral_arg< signed char >
class  QString
struct  QtPrivate::ArgBase
struct  QtPrivate::QStringViewArg
struct  QtPrivate::QLatin1StringArg
struct  QtPrivate::QAnyStringArg

Namespaces

namespace  QtPrivate
namespace  Qt
namespace  Qt::Literals
namespace  Qt::Literals::StringLiterals
namespace  QtLiterals

Macros

#define qPrintable(string)
#define qUtf8Printable(string)
#define qUtf16Printable(string)
#define QT_UNICODE_LITERAL(str)
#define QStringLiteral(str)

Typedefs

template<typename Char>
using QtPrivate::IsCompatibleChar32TypeHelper
template<typename Char>
using QtPrivate::IsCompatibleChar32Type = IsCompatibleChar32TypeHelper<q20::remove_cvref_t<Char>>
using QStringPrivate = QArrayDataPointer<char16_t>

Functions

QString operator+ (const QString &s1, const QString &s2)
QString operator+ (QString &&lhs, const QString &rhs)
QString operator+ (const QString &s1, QChar s2)
QString operator+ (QString &&lhs, QChar rhs)
QString operator+ (QChar s1, const QString &s2)
QString operator+ (const QString &lhs, QStringView rhs)
QString operator+ (QStringView lhs, const QString &rhs)
QT_ASCII_CAST_WARN QString operator+ (const QString &s1, const char *s2)
QT_ASCII_CAST_WARN QString operator+ (QString &&lhs, const char *rhs)
QT_ASCII_CAST_WARN QString operator+ (const char *s1, const QString &s2)
QT_ASCII_CAST_WARN QString operator+ (const QByteArray &ba, const QString &s)
QT_ASCII_CAST_WARN QString operator+ (const QString &s, const QByteArray &ba)
QT_ASCII_CAST_WARN QString operator+ (QString &&lhs, const QByteArray &rhs)
Q_CORE_EXPORT QDataStreamoperator<< (QDataStream &out, const QString &str)
Q_CORE_EXPORT QDataStreamoperator>> (QDataStream &in, QString &str)
const QStringQtPrivate::asString (const QString &s)
QString && QtPrivate::asString (QString &&s)
Q_CORE_EXPORT QString QtPrivate::argToQString (QAnyStringView pattern, size_t n, const ArgBase **args)
template<typename... Args>
Q_ALWAYS_INLINE QString QtPrivate::argToQStringDispatch (QAnyStringView pattern, const Args &...args)
constexpr QAnyStringArg QtPrivate::qStringLikeToArg (QAnyStringView s) noexcept
template<typename T>
qsizetype erase (QString &s, const T &t)
template<typename Predicate>
qsizetype erase_if (QString &s, Predicate pred)
QString Qt::Literals::StringLiterals::operator""_s (const char16_t *str, size_t size) noexcept
template<qsizetype N>
static Q_ALWAYS_INLINE QStringPrivate QtPrivate::qMakeStringPrivate (const char16_t(&literal)[N])

Macro Definition Documentation

◆ qPrintable

#define qPrintable ( string)
Value:
const char * constData() const noexcept
Returns a pointer to the const data stored in the byte array.
Definition qbytearray.h:136
QByteArray toLocal8Bit() const &
Definition qstring.h:761
const QString & asString(const QString &s)
Definition qstring.h:1680

Definition at line 1685 of file qstring.h.

◆ QStringLiteral

#define QStringLiteral ( str)
Value:
static Q_ALWAYS_INLINE QStringPrivate qMakeStringPrivate(const char16_t(&literal)[N])
Definition qstring.h:1818
#define QT_UNICODE_LITERAL(str)
Definition qstring.h:1814
QString str("QStringBuilder")
[5]

Definition at line 1826 of file qstring.h.

◆ QT_UNICODE_LITERAL

#define QT_UNICODE_LITERAL ( str)
Value:
u"" str

Definition at line 1814 of file qstring.h.

◆ qUtf16Printable

#define qUtf16Printable ( string)
Value:
static_cast<const wchar_t*>(static_cast<const void*>(QtPrivate::asString(string).utf16()))
const ushort * utf16() const
Returns the QString as a '\0\'-terminated array of unsigned shorts.
Definition qstring.cpp:7064

Definition at line 1697 of file qstring.h.

◆ qUtf8Printable

#define qUtf8Printable ( string)
Value:
QByteArray toUtf8() const &
Definition qstring.h:757

Definition at line 1689 of file qstring.h.

Typedef Documentation

◆ QStringPrivate

using QStringPrivate = QArrayDataPointer<char16_t>

Definition at line 174 of file qstring.h.

Function Documentation

◆ erase()

template<typename T>
qsizetype erase ( QString & s,
const T & t )

Definition at line 1774 of file qstring.h.

◆ erase_if()

template<typename Predicate>
qsizetype erase_if ( QString & s,
Predicate pred )

Definition at line 1780 of file qstring.h.

◆ operator+() [1/13]

QT_ASCII_CAST_WARN QString operator+ ( const char * s1,
const QString & s2 )
related

Definition at line 1584 of file qstring.h.

◆ operator+() [2/13]

QT_ASCII_CAST_WARN QString operator+ ( const QByteArray & ba,
const QString & s )
inline

Definition at line 1586 of file qstring.h.

◆ operator+() [3/13]

QString operator+ ( const QString & lhs,
QStringView rhs )
related

Definition at line 1568 of file qstring.h.

◆ operator+() [4/13]

QT_ASCII_CAST_WARN QString operator+ ( const QString & s,
const QByteArray & ba )
inline

Definition at line 1588 of file qstring.h.

◆ operator+() [5/13]

QT_ASCII_CAST_WARN QString operator+ ( const QString & s1,
const char * s2 )
related

Definition at line 1580 of file qstring.h.

◆ operator+() [6/13]

QString operator+ ( const QString & s1,
const QString & s2 )
inline

Definition at line 1558 of file qstring.h.

◆ operator+() [7/13]

QString operator+ ( const QString & s1,
QChar s2 )
inline

Definition at line 1562 of file qstring.h.

◆ operator+() [8/13]

QString operator+ ( QChar s1,
const QString & s2 )
inline

Definition at line 1566 of file qstring.h.

◆ operator+() [9/13]

QT_ASCII_CAST_WARN QString operator+ ( QString && lhs,
const char * rhs )
inline

Definition at line 1582 of file qstring.h.

◆ operator+() [10/13]

QT_ASCII_CAST_WARN QString operator+ ( QString && lhs,
const QByteArray & rhs )
inline

Definition at line 1590 of file qstring.h.

◆ operator+() [11/13]

QString operator+ ( QString && lhs,
const QString & rhs )
related

Definition at line 1560 of file qstring.h.

◆ operator+() [12/13]

QString operator+ ( QString && lhs,
QChar rhs )
inline

Definition at line 1564 of file qstring.h.

◆ operator+() [13/13]

QString operator+ ( QStringView lhs,
const QString & rhs )
inline

Definition at line 1573 of file qstring.h.

◆ operator<<()

QDataStream & operator<< ( QDataStream & out,
const QString & str )
related

Definition at line 9543 of file qstring.cpp.

◆ operator>>()

QDataStream & operator>> ( QDataStream & in,
QString & str )
related

Definition at line 9574 of file qstring.cpp.