summaryrefslogtreecommitdiffstats
path: root/src/corelib/text/qstringview.cpp
diff options
context:
space:
mode:
authorMarc Mutz <marc.mutz@kdab.com>2019-07-29 09:44:04 +0300
committerMarc Mutz <marc.mutz@kdab.com>2020-03-05 07:50:02 +0000
commitb2f79cceb11dfd15ac9eea631bc18ad6b036eb91 (patch)
treee62b5eb13af680134fb1cc40ff28e28cb4d511a9 /src/corelib/text/qstringview.cpp
parent728cc964f3f25d23c72317a119b839701f5941e8 (diff)
QLatin1String/QStringView: add (missing) member compare()
[ChangeLog][QtCore][QLatin1String] Added compare(). [ChangeLog][QtCore][QStringView] Added compare() overloads taking QLatin1String, QChar. Change-Id: Ie2aa400299cb63495e65ce29b2a32133066de826 Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Diffstat (limited to 'src/corelib/text/qstringview.cpp')
-rw-r--r--src/corelib/text/qstringview.cpp26
1 files changed, 20 insertions, 6 deletions
diff --git a/src/corelib/text/qstringview.cpp b/src/corelib/text/qstringview.cpp
index 08dade7e68..9df656dc59 100644
--- a/src/corelib/text/qstringview.cpp
+++ b/src/corelib/text/qstringview.cpp
@@ -692,15 +692,29 @@ QT_BEGIN_NAMESPACE
*/
/*!
- \fn int QStringView::compare(QStringView other, Qt::CaseSensitivity cs) const
+ \fn int QStringView::compare(QStringView str, Qt::CaseSensitivity cs) const
\since 5.12
- Compares this string-view with the \a other string-view and returns an
- integer less than, equal to, or greater than zero if this string-view
- is less than, equal to, or greater than the other string-view.
+ Returns an integer that compares to zero as this string-view compares to the
+ string-view \a str.
- If \a cs is Qt::CaseSensitive, the comparison is case sensitive;
- otherwise the comparison is case insensitive.
+ If \a cs is Qt::CaseSensitive (the default), the comparison is case sensitive;
+ otherwise the comparison is case-insensitive.
+
+ \sa operator==(), operator<(), operator>()
+*/
+
+/*!
+ \fn int QStringView::compare(QLatin1String l1, Qt::CaseSensitivity cs) const
+ \fn int QStringView::compare(QChar ch) const
+ \fn int QStringView::compare(QChar ch, Qt::CaseSensitivity cs) const
+ \since 5.14
+
+ Returns an integer that compares to zero as this string-view compares to the
+ Latin-1 string \a l1, or character \a ch, respectively.
+
+ If \a cs is Qt::CaseSensitive (the default), the comparison is case sensitive;
+ otherwise the comparison is case-insensitive.
\sa operator==(), operator<(), operator>()
*/