summaryrefslogtreecommitdiffstats
path: root/src/corelib/text/qstringalgorithms.h
diff options
context:
space:
mode:
authorLars Knoll <lars.knoll@qt.io>2020-05-22 09:57:33 +0200
committerLars Knoll <lars.knoll@qt.io>2020-05-30 23:11:09 +0200
commita1056096fc5ec316a650fd8ae1c2a22b6944d091 (patch)
tree8586103ce9378295addf3f7d3fc0beae2d9e6664 /src/corelib/text/qstringalgorithms.h
parent2b7b75f721b6786a6dc35e2f9b693bb2e2dfac01 (diff)
Add support for count() to QStringView
Make the API more symmetric with regards to both QString and QStringRef. Change-Id: Ia67c53ba708f6c33874d1a127de8e2857ad9b5b8 Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
Diffstat (limited to 'src/corelib/text/qstringalgorithms.h')
-rw-r--r--src/corelib/text/qstringalgorithms.h3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/corelib/text/qstringalgorithms.h b/src/corelib/text/qstringalgorithms.h
index 86bacdccad..f1aa052eac 100644
--- a/src/corelib/text/qstringalgorithms.h
+++ b/src/corelib/text/qstringalgorithms.h
@@ -88,6 +88,9 @@ Q_REQUIRED_RESULT Q_CORE_EXPORT Q_DECL_PURE_FUNCTION qsizetype lastIndexOf(QLati
Q_REQUIRED_RESULT Q_CORE_EXPORT Q_DECL_PURE_FUNCTION QStringView trimmed(QStringView s) noexcept;
Q_REQUIRED_RESULT Q_CORE_EXPORT Q_DECL_PURE_FUNCTION QLatin1String trimmed(QLatin1String s) noexcept;
+Q_REQUIRED_RESULT Q_CORE_EXPORT Q_DECL_PURE_FUNCTION qsizetype count(QStringView haystack, QChar needle, Qt::CaseSensitivity cs = Qt::CaseSensitive) noexcept;
+Q_REQUIRED_RESULT Q_CORE_EXPORT Q_DECL_PURE_FUNCTION qsizetype count(QStringView haystack, QStringView needle, Qt::CaseSensitivity cs = Qt::CaseSensitive) noexcept;
+
Q_REQUIRED_RESULT Q_CORE_EXPORT QByteArray convertToLatin1(QStringView str);
Q_REQUIRED_RESULT Q_CORE_EXPORT QByteArray convertToUtf8(QStringView str);
Q_REQUIRED_RESULT Q_CORE_EXPORT QByteArray convertToLocal8Bit(QStringView str);