summaryrefslogtreecommitdiffstats
path: root/src/corelib/text/qbytearray.cpp
diff options
context:
space:
mode:
authorSona Kurazyan <sona.kurazyan@qt.io>2020-08-25 13:24:07 +0200
committerThiago Macieira <thiago.macieira@intel.com>2020-08-26 14:37:43 +0000
commit7d35e31efb1a58c529ffefc4a5941511024eeabc (patch)
treed8ceca462facc6a97ef2f448a2ad91c5938411c6 /src/corelib/text/qbytearray.cpp
parentfe4b246446f721085946e399b96a42eccfcecca8 (diff)
Add back QByteArray's relational operators taking QString
QString still has the overloads of relational operators taking QByteArray. Add back QByteArray's relational operators taking QString for symmetry. See also the comments of d7ccd8cb4565c8643b158891c9de3187c1586dc9 for more details. [ChangeLog][EDITORIAL] Remove the changelog about QString/QByteArray operators being removed. They're back. Change-Id: I22c95e727285cf8a5ef79b3a4f9d45cb66319252 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Diffstat (limited to 'src/corelib/text/qbytearray.cpp')
-rw-r--r--src/corelib/text/qbytearray.cpp84
1 files changed, 84 insertions, 0 deletions
diff --git a/src/corelib/text/qbytearray.cpp b/src/corelib/text/qbytearray.cpp
index bcbbdc234f..041fb06554 100644
--- a/src/corelib/text/qbytearray.cpp
+++ b/src/corelib/text/qbytearray.cpp
@@ -2991,6 +2991,90 @@ QDataStream &operator>>(QDataStream &in, QByteArray &ba)
}
#endif // QT_NO_DATASTREAM
+/*! \fn bool QByteArray::operator==(const QString &str) const
+
+ Returns \c true if this byte array is equal to the UTF-8 encoding of \a str;
+ otherwise returns \c false.
+
+ The comparison is case sensitive.
+
+ You can disable this operator by defining \c
+ QT_NO_CAST_FROM_ASCII when you compile your applications. You
+ then need to call QString::fromUtf8(), QString::fromLatin1(),
+ or QString::fromLocal8Bit() explicitly if you want to convert the byte
+ array to a QString before doing the comparison.
+*/
+
+/*! \fn bool QByteArray::operator!=(const QString &str) const
+
+ Returns \c true if this byte array is not equal to the UTF-8 encoding of \a
+ str; otherwise returns \c false.
+
+ The comparison is case sensitive.
+
+ You can disable this operator by defining \c
+ QT_NO_CAST_FROM_ASCII when you compile your applications. You
+ then need to call QString::fromUtf8(), QString::fromLatin1(),
+ or QString::fromLocal8Bit() explicitly if you want to convert the byte
+ array to a QString before doing the comparison.
+*/
+
+/*! \fn bool QByteArray::operator<(const QString &str) const
+
+ Returns \c true if this byte array is lexically less than the UTF-8 encoding
+ of \a str; otherwise returns \c false.
+
+ The comparison is case sensitive.
+
+ You can disable this operator by defining \c
+ QT_NO_CAST_FROM_ASCII when you compile your applications. You
+ then need to call QString::fromUtf8(), QString::fromLatin1(),
+ or QString::fromLocal8Bit() explicitly if you want to convert the byte
+ array to a QString before doing the comparison.
+*/
+
+/*! \fn bool QByteArray::operator>(const QString &str) const
+
+ Returns \c true if this byte array is lexically greater than the UTF-8
+ encoding of \a str; otherwise returns \c false.
+
+ The comparison is case sensitive.
+
+ You can disable this operator by defining \c
+ QT_NO_CAST_FROM_ASCII when you compile your applications. You
+ then need to call QString::fromUtf8(), QString::fromLatin1(),
+ or QString::fromLocal8Bit() explicitly if you want to convert the byte
+ array to a QString before doing the comparison.
+*/
+
+/*! \fn bool QByteArray::operator<=(const QString &str) const
+
+ Returns \c true if this byte array is lexically less than or equal to the
+ UTF-8 encoding of \a str; otherwise returns \c false.
+
+ The comparison is case sensitive.
+
+ You can disable this operator by defining \c
+ QT_NO_CAST_FROM_ASCII when you compile your applications. You
+ then need to call QString::fromUtf8(), QString::fromLatin1(),
+ or QString::fromLocal8Bit() explicitly if you want to convert the byte
+ array to a QString before doing the comparison.
+*/
+
+/*! \fn bool QByteArray::operator>=(const QString &str) const
+
+ Returns \c true if this byte array is greater than or equal to the UTF-8
+ encoding of \a str; otherwise returns \c false.
+
+ The comparison is case sensitive.
+
+ You can disable this operator by defining \c
+ QT_NO_CAST_FROM_ASCII when you compile your applications. You
+ then need to call QString::fromUtf8(), QString::fromLatin1(),
+ or QString::fromLocal8Bit() explicitly if you want to convert the byte
+ array to a QString before doing the comparison.
+*/
+
/*! \fn bool operator==(const QByteArray &a1, const QByteArray &a2)
\relates QByteArray