From d21a147e2bad29906696125605328a563cd7ed2f Mon Sep 17 00:00:00 2001 From: Marc Mutz Date: Mon, 24 Apr 2017 11:32:17 +0200 Subject: QStringView: add startsWith(), endsWith() Change-Id: I72aef9236daedc3013c62d3f1d737159f85572b8 Reviewed-by: Lars Knoll --- src/corelib/tools/qstringview.cpp | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) (limited to 'src/corelib/tools/qstringview.cpp') diff --git a/src/corelib/tools/qstringview.cpp b/src/corelib/tools/qstringview.cpp index 3b36ed9bf8..258b05ada6 100644 --- a/src/corelib/tools/qstringview.cpp +++ b/src/corelib/tools/qstringview.cpp @@ -653,6 +653,38 @@ QT_BEGIN_NAMESPACE \sa mid(), left(), right(), chopped(), truncate() */ +/*! + \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 + \fn bool QStringView::startsWith(QChar ch, Qt::CaseSensitivity cs) const + + Returns \c true if this string-view starts with string-view \a str, + Latin-1 string \a l1, or character \a ch, respectively; + otherwise returns \c false. + + If \a cs is Qt::CaseSensitive (the default), the search is case-sensitive; + otherwise the search is case-insensitive. + + \sa endsWith(), qStartsWith() +*/ + +/*! + \fn bool QStringView::endsWith(QStringView str, Qt::CaseSensitivity cs) const + \fn bool QStringView::endsWith(QLatin1String l1, Qt::CaseSensitivity cs) const + \fn bool QStringView::endsWith(QChar ch) const + \fn bool QStringView::endsWith(QChar ch, Qt::CaseSensitivity cs) const + + Returns \c true if this string-view ends with string-view \a str, + Latin-1 string \a l1, or character \a ch, respectively; + otherwise returns \c false. + + If \a cs is Qt::CaseSensitive (the default), the search is case-sensitive; + otherwise the search is case-insensitive. + + \sa startsWith(), qEndsWith() +*/ + /*! \fn QByteArray QStringView::toLatin1() const -- cgit v1.2.3