summaryrefslogtreecommitdiffstats
path: root/src/corelib/tools/qstringview.cpp
diff options
context:
space:
mode:
authorMarc Mutz <marc.mutz@kdab.com>2017-04-24 11:32:17 +0200
committerMarc Mutz <marc.mutz@kdab.com>2017-04-28 16:41:36 +0000
commitd21a147e2bad29906696125605328a563cd7ed2f (patch)
treec047b8e493cc3d6ae8cc638f25a8be1e145e2fb5 /src/corelib/tools/qstringview.cpp
parent5f3d6ce5709466d08b11b6f2c8608d131e7c3f43 (diff)
QStringView: add startsWith(), endsWith()
Change-Id: I72aef9236daedc3013c62d3f1d737159f85572b8 Reviewed-by: Lars Knoll <lars.knoll@qt.io>
Diffstat (limited to 'src/corelib/tools/qstringview.cpp')
-rw-r--r--src/corelib/tools/qstringview.cpp32
1 files changed, 32 insertions, 0 deletions
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
@@ -654,6 +654,38 @@ QT_BEGIN_NAMESPACE
*/
/*!
+ \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
Returns a Latin-1 representation of the string as a QByteArray.