From 019dd88d2cf63ff065bfd801876b213e8193c60f Mon Sep 17 00:00:00 2001 From: Friedemann Kleint Date: Wed, 11 Jul 2018 12:59:30 +0200 Subject: QStringView: Add compare() member function There was no public API for doing case-insensitive comparisons of QStringView. Task-number: QTBUG-69389 Change-Id: I1b021eefec35e135b97fb87704c8dc137232d83d Reviewed-by: Edward Welbourne Reviewed-by: Thiago Macieira --- src/corelib/tools/qstringview.cpp | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'src/corelib/tools/qstringview.cpp') diff --git a/src/corelib/tools/qstringview.cpp b/src/corelib/tools/qstringview.cpp index 0e3246c72c5..ce8fdacafb5 100644 --- a/src/corelib/tools/qstringview.cpp +++ b/src/corelib/tools/qstringview.cpp @@ -680,6 +680,20 @@ QT_BEGIN_NAMESPACE '\\f', '\\r', and ' '. */ +/*! + \fn int QStringView::compare(QStringView other, 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. + + If \a cs is Qt::CaseSensitive, the comparison is case sensitive; + otherwise the comparison is case insensitive. + + \sa operator==(), operator<(), operator>() +*/ + /*! \fn bool QStringView::startsWith(QStringView str, Qt::CaseSensitivity cs) const \fn bool QStringView::startsWith(QLatin1String l1, Qt::CaseSensitivity cs) const -- cgit v1.2.3