diff options
author | Anton Kudryavtsev <anton.kudryavtsev@corp.mail.ru> | 2019-03-25 14:42:19 +0300 |
---|---|---|
committer | Anton Kudryavtsev <antkudr@mail.ru> | 2019-05-10 07:16:42 +0000 |
commit | 681bd76e671939b6717f1a35ec9b8383f48fb294 (patch) | |
tree | 79d2676f06c111b9674e95d519852733d72c75a8 /src/corelib/tools/qstringview.cpp | |
parent | daaa55725969aed87665c366d7cc96304c4e5f4c (diff) |
QStringView, QLatin1String: add indexOf methods
[ChangeLog][QtCore][QLatin1String] Added indexOf().
[ChangeLog][QtCore][QStringView] Added indexOf().
Change-Id: I9f56e5b40030e39b29e50914a46beb58013b537b
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Diffstat (limited to 'src/corelib/tools/qstringview.cpp')
-rw-r--r-- | src/corelib/tools/qstringview.cpp | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/src/corelib/tools/qstringview.cpp b/src/corelib/tools/qstringview.cpp index c863ca7ce2..160654b419 100644 --- a/src/corelib/tools/qstringview.cpp +++ b/src/corelib/tools/qstringview.cpp @@ -721,6 +721,25 @@ QT_BEGIN_NAMESPACE */ /*! + \fn qsizetype QStringView::indexOf(QStringView str, qsizetype from, Qt::CaseSensitivity cs) const + \fn qsizetype QStringView::indexOf(QLatin1String l1, qsizetype from Qt::CaseSensitivity cs) const + \fn qsizetype QStringView::indexOf(QChar c, qsizetype from, Qt::CaseSensitivity cs) const + \since 5.14 + + Returns the index position of the first occurrence of the string-view \a str, + Latin-1 string \a l1, or character \a ch, respectively, in this string-view, + searching forward from index position \a from. Returns -1 if \a str is not found. + + If \a cs is Qt::CaseSensitive (default), the search is case + sensitive; otherwise the search is case insensitive. + + If \a from is -1, the search starts at the last character; if it is + -2, at the next to last character and so on. + + \sa QString::indexOf() +*/ + +/*! \fn QByteArray QStringView::toLatin1() const Returns a Latin-1 representation of the string as a QByteArray. |