From b2f79cceb11dfd15ac9eea631bc18ad6b036eb91 Mon Sep 17 00:00:00 2001 From: Marc Mutz Date: Mon, 29 Jul 2019 09:44:04 +0300 Subject: 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 Reviewed-by: Thiago Macieira --- src/corelib/text/qstringview.cpp | 26 ++++++++++++++++++++------ 1 file changed, 20 insertions(+), 6 deletions(-) (limited to 'src/corelib/text/qstringview.cpp') 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>() */ -- cgit v1.2.3