summaryrefslogtreecommitdiffstats
path: root/src/corelib/text/qstringview.h
diff options
context:
space:
mode:
authorLars Knoll <lars.knoll@qt.io>2020-09-23 09:55:54 +0200
committerLars Knoll <lars.knoll@qt.io>2020-10-15 11:29:21 +0200
commitf2b8412f91198ef1d00c06a05183de1768b85757 (patch)
tree602e1744238985a6bf6fb0e857b756305b302c90 /src/corelib/text/qstringview.h
parentfcbeebc5828228078c38329940fabb80f22e3909 (diff)
Add QStringView::split()
The implementation has to live in qstringlist.h and qregularexpression.h, as those classes are only forward declared in qstring.h. Task-number: QTBUG-86516 Change-Id: Ia9b3ff48999d1c2e7df905191ee192764b309d08 Reviewed-by: MÃ¥rten Nordheim <marten.nordheim@qt.io>
Diffstat (limited to 'src/corelib/text/qstringview.h')
-rw-r--r--src/corelib/text/qstringview.h14
1 files changed, 14 insertions, 0 deletions
diff --git a/src/corelib/text/qstringview.h b/src/corelib/text/qstringview.h
index e599e5a8c2..5e561d88a8 100644
--- a/src/corelib/text/qstringview.h
+++ b/src/corelib/text/qstringview.h
@@ -55,6 +55,7 @@ QT_BEGIN_NAMESPACE
class QString;
class QStringRef;
+class QRegularExpression;
namespace QtPrivate {
template <typename Char>
@@ -323,6 +324,19 @@ public:
Q_REQUIRED_RESULT inline int toWCharArray(wchar_t *array) const; // defined in qstring.h
+ Q_REQUIRED_RESULT inline
+ QList<QStringView> split(QStringView sep,
+ Qt::SplitBehavior behavior = Qt::KeepEmptyParts,
+ Qt::CaseSensitivity cs = Qt::CaseSensitive) const;
+ Q_REQUIRED_RESULT inline
+ QList<QStringView> split(QChar sep, Qt::SplitBehavior behavior = Qt::KeepEmptyParts,
+ Qt::CaseSensitivity cs = Qt::CaseSensitive) const;
+
+#if QT_CONFIG(regularexpression)
+ Q_REQUIRED_RESULT inline
+ QList<QStringView> split(const QRegularExpression &sep, Qt::SplitBehavior behavior = Qt::KeepEmptyParts) const;
+#endif
+
//
// STL compatibility API:
//