diff options
Diffstat (limited to 'src/corelib')
-rw-r--r-- | src/corelib/tools/qstringview.cpp | 14 | ||||
-rw-r--r-- | src/corelib/tools/qstringview.h | 3 |
2 files changed, 17 insertions, 0 deletions
diff --git a/src/corelib/tools/qstringview.cpp b/src/corelib/tools/qstringview.cpp index 0e3246c72c..ce8fdacafb 100644 --- a/src/corelib/tools/qstringview.cpp +++ b/src/corelib/tools/qstringview.cpp @@ -681,6 +681,20 @@ QT_BEGIN_NAMESPACE */ /*! + \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 \fn bool QStringView::startsWith(QChar ch) const diff --git a/src/corelib/tools/qstringview.h b/src/corelib/tools/qstringview.h index 4f7d48fe1d..2e95c2b218 100644 --- a/src/corelib/tools/qstringview.h +++ b/src/corelib/tools/qstringview.h @@ -250,6 +250,9 @@ public: Q_REQUIRED_RESULT QStringView trimmed() const Q_DECL_NOTHROW { return QtPrivate::trimmed(*this); } + Q_REQUIRED_RESULT int compare(QStringView other, Qt::CaseSensitivity cs = Qt::CaseSensitive) const Q_DECL_NOTHROW + { return QtPrivate::compareStrings(*this, other, cs); } + Q_REQUIRED_RESULT bool startsWith(QStringView s, Qt::CaseSensitivity cs = Qt::CaseSensitive) const Q_DECL_NOTHROW { return QtPrivate::startsWith(*this, s, cs); } Q_REQUIRED_RESULT inline bool startsWith(QLatin1String s, Qt::CaseSensitivity cs = Qt::CaseSensitive) const Q_DECL_NOTHROW; |