summaryrefslogtreecommitdiffstats
path: root/src/corelib/text/qbytearraymatcher.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/corelib/text/qbytearraymatcher.h')
-rw-r--r--src/corelib/text/qbytearraymatcher.h14
1 files changed, 10 insertions, 4 deletions
diff --git a/src/corelib/text/qbytearraymatcher.h b/src/corelib/text/qbytearraymatcher.h
index 80473c7585..7aa6226b24 100644
--- a/src/corelib/text/qbytearraymatcher.h
+++ b/src/corelib/text/qbytearraymatcher.h
@@ -65,12 +65,15 @@ public:
void setPattern(const QByteArray &pattern);
+#if QT_REMOVED_SINCE(6, 3)
qsizetype indexIn(const QByteArray &ba, qsizetype from = 0) const;
+#else
+ Q_WEAK_OVERLOAD
+ qsizetype indexIn(const QByteArray &ba, qsizetype from = 0) const
+ { return indexIn(QByteArrayView{ba}, from); }
+#endif
qsizetype indexIn(const char *str, qsizetype len, qsizetype from = 0) const;
- qsizetype indexIn(QByteArrayView data, qsizetype from = 0) const
- {
- return indexIn(data.data(), data.size(), from);
- }
+ qsizetype indexIn(QByteArrayView data, qsizetype from = 0) const;
inline QByteArray pattern() const
{
if (q_pattern.isNull())
@@ -162,10 +165,13 @@ public:
m_pattern[i] = patternToMatch[i];
}
+ Q_WEAK_OVERLOAD
qsizetype indexIn(const QByteArray &haystack, qsizetype from = 0) const noexcept
{ return this->indexOfIn(m_pattern, N - 1, haystack.data(), haystack.size(), from); }
qsizetype indexIn(const char *haystack, qsizetype hlen, qsizetype from = 0) const noexcept
{ return this->indexOfIn(m_pattern, N - 1, haystack, hlen, from); }
+ qsizetype indexIn(QByteArrayView haystack, qsizetype from = 0) const noexcept
+ { return this->indexOfIn(m_pattern, N - 1, haystack.data(), haystack.size(), from); }
QByteArray pattern() const { return QByteArray(m_pattern, qsizetype(N - 1)); }
};