From 0b62d7118fb47a979b36370a01fff49fb1246cce Mon Sep 17 00:00:00 2001 From: Marc Mutz Date: Tue, 15 Feb 2022 11:48:32 +0100 Subject: [PATCH] QRegularExpression: eradicate QT_STRINGVIEW_LEVEL MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit It's not used and not useful. Task-number: QTBUG-100861 Change-Id: Ie28d07474ee8fae96b569632d835dbb0ffd0e48f Reviewed-by: Thiago Macieira Reviewed-by: Giuseppe D'Angelo (cherry picked from commit 04c54858c705fc8c951a438127c7791dd455b194) Reviewed-by: MÃ¥rten Nordheim --- src/corelib/text/qregularexpression.cpp | 10 ---------- src/corelib/text/qregularexpression.h | 7 ------- 2 files changed, 17 deletions(-) diff --git a/src/corelib/text/qregularexpression.cpp b/src/corelib/text/qregularexpression.cpp index b0728bca4a0..881e1111e74 100644 --- a/src/corelib/text/qregularexpression.cpp +++ b/src/corelib/text/qregularexpression.cpp @@ -1786,12 +1786,10 @@ size_t qHash(const QRegularExpression &key, size_t seed) noexcept return qHashMulti(seed, key.d->pattern, key.d->patternOptions); } -#if QT_STRINGVIEW_LEVEL < 2 /*! \fn QString QRegularExpression::escape(const QString &str) \overload */ -#endif // QT_STRINGVIEW_LEVEL < 2 /*! \since 5.15 @@ -1848,13 +1846,11 @@ QString QRegularExpression::escape(QStringView str) return result; } -#if QT_STRINGVIEW_LEVEL < 2 /*! \since 5.12 \fn QString QRegularExpression::wildcardToRegularExpression(const QString &pattern, WildcardConversionOptions options) \overload */ -#endif // QT_STRINGVIEW_LEVEL < 2 /*! \since 6.0 @@ -2024,13 +2020,11 @@ QRegularExpression QRegularExpression::fromWildcard(QStringView pattern, Qt::Cas return QRegularExpression(wildcardToRegularExpression(pattern, options), reOptions); } -#if QT_STRINGVIEW_LEVEL < 2 /*! \fn QRegularExpression::anchoredPattern(const QString &expression) \since 5.12 \overload */ -#endif // QT_STRINGVIEW_LEVEL < 2 /*! \since 5.15 @@ -2235,7 +2229,6 @@ QStringView QRegularExpressionMatch::capturedView(int nth) const return d->subject.mid(start, capturedLength(nth)); } -#if QT_STRINGVIEW_LEVEL < 2 /*! \fn QString QRegularExpressionMatch::captured(const QString &name) const Returns the substring captured by the capturing group named \a name. @@ -2246,7 +2239,6 @@ QStringView QRegularExpressionMatch::capturedView(int nth) const \sa capturedView(), capturedStart(), capturedEnd(), capturedLength(), QString::isNull() */ -#endif // QT_STRINGVIEW_LEVEL < 2 /*! \since 5.10 @@ -2353,7 +2345,6 @@ qsizetype QRegularExpressionMatch::capturedEnd(int nth) const return d->capturedOffsets.at(nth * 2 + 1); } -#if QT_STRINGVIEW_LEVEL < 2 /*! \fn qsizetype QRegularExpressionMatch::capturedStart(const QString &name) const Returns the offset inside the subject string corresponding to the starting @@ -2384,7 +2375,6 @@ qsizetype QRegularExpressionMatch::capturedEnd(int nth) const \sa capturedStart(), capturedLength(), captured() */ -#endif // QT_STRINGVIEW_LEVEL < 2 /*! \since 5.10 diff --git a/src/corelib/text/qregularexpression.h b/src/corelib/text/qregularexpression.h index 570679800c6..aabec22870d 100644 --- a/src/corelib/text/qregularexpression.h +++ b/src/corelib/text/qregularexpression.h @@ -155,7 +155,6 @@ public: }; Q_DECLARE_FLAGS(WildcardConversionOptions, WildcardConversionOption) -#if QT_STRINGVIEW_LEVEL < 2 static QString escape(const QString &str) { return escape(qToStringViewIgnoringNull(str)); @@ -170,7 +169,6 @@ public: { return anchoredPattern(qToStringViewIgnoringNull(expression)); } -#endif static QString escape(QStringView str); static QString wildcardToRegularExpression(QStringView str, WildcardConversionOptions options = DefaultWildcardConversion); @@ -236,11 +234,8 @@ public: QString captured(int nth = 0) const; QStringView capturedView(int nth = 0) const; -#if QT_STRINGVIEW_LEVEL < 2 QString captured(const QString &name) const { return captured(QStringView(name)); } -#endif - QString captured(QStringView name) const; QStringView capturedView(QStringView name) const; @@ -250,14 +245,12 @@ public: qsizetype capturedLength(int nth = 0) const; qsizetype capturedEnd(int nth = 0) const; -#if QT_STRINGVIEW_LEVEL < 2 qsizetype capturedStart(const QString &name) const { return capturedStart(QStringView(name)); } qsizetype capturedLength(const QString &name) const { return capturedLength(QStringView(name)); } qsizetype capturedEnd(const QString &name) const { return capturedEnd(QStringView(name)); } -#endif qsizetype capturedStart(QStringView name) const; qsizetype capturedLength(QStringView name) const;