diff options
author | Marc Mutz <marc.mutz@kdab.com> | 2015-10-25 19:02:40 +0100 |
---|---|---|
committer | Marc Mutz <marc.mutz@kdab.com> | 2020-04-24 10:45:09 +0000 |
commit | 3238445b270d5fb98f4008cb10a8adcc2d35165c (patch) | |
tree | 1781a4e7c3a0bd8ca9675b90ab79fb5c99b4a1cb /src/corelib/text/qstring.cpp | |
parent | d737db87349f4d3e9d5ff2cb4758d270cb8f1db7 (diff) |
QString: add append, op+=, prepend, insert taking QStringView
[ChangeLog][QtCore][QString] Now supports appending, prepending
and inserting QStringViews.
Change-Id: I7538c050c67590f27d91443eda0b94a4b80b62f2
Reviewed-by: Anton Kudryavtsev <antkudr@mail.ru>
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
Diffstat (limited to 'src/corelib/text/qstring.cpp')
-rw-r--r-- | src/corelib/text/qstring.cpp | 35 |
1 files changed, 35 insertions, 0 deletions
diff --git a/src/corelib/text/qstring.cpp b/src/corelib/text/qstring.cpp index 3f24665a8a..fa61b5939d 100644 --- a/src/corelib/text/qstring.cpp +++ b/src/corelib/text/qstring.cpp @@ -2501,6 +2501,19 @@ QString &QString::operator=(QChar ch) /*! + \fn QString& QString::insert(int position, QStringView str) + \since 6.0 + \overload insert() + + Inserts the string view \a str at the given index \a position and + returns a reference to this string. + + If the given \a position is greater than size(), the array is + first extended using resize(). +*/ + + +/*! \fn QString& QString::insert(int position, const char *str) \since 5.5 \overload insert() @@ -2765,6 +2778,14 @@ QString &QString::append(QChar ch) returns a reference to this string. */ +/*! \fn QString &QString::prepend(QStringView str) + \since 6.0 + \overload prepend() + + Prepends the string view \a str to the beginning of this string and + returns a reference to this string. +*/ + /*! \fn QString &QString::prepend(const QByteArray &ba) \overload prepend() @@ -5914,6 +5935,13 @@ QString& QString::fill(QChar ch, int size) Appends the string section referenced by \a str to this string. */ +/*! \fn QString &QString::operator+=(QStringView str) + \since 6.0 + \overload operator+=() + + Appends the string view \a str to this string. +*/ + /*! \fn QString &QString::operator+=(char ch) \overload operator+=() @@ -11038,6 +11066,13 @@ QStringRef QStringRef::appendTo(QString *string) const */ /*! + \fn QString &QString::append(QStringView str) + \since 6.0 + + Appends the given string view \a str to this string and returns the result. +*/ + +/*! \fn QString &QString::append(const QStringRef &reference) \since 4.4 |