From 53b7cb1bd73c773521f85c48ecd0c9daed14f7b3 Mon Sep 17 00:00:00 2001 From: Giuseppe D'Angelo Date: Wed, 2 Dec 2020 12:30:14 +0100 Subject: [PATCH] QRegularExpression: plaster some [[nodiscard]] On some of the "most important" API. Change-Id: I800b53bb7b9a95d0184f813e7ba501a7ebd485c0 Reviewed-by: Thiago Macieira --- src/corelib/text/qregularexpression.h | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/corelib/text/qregularexpression.h b/src/corelib/text/qregularexpression.h index b588dbf384..142ec7f838 100644 --- a/src/corelib/text/qregularexpression.h +++ b/src/corelib/text/qregularexpression.h @@ -95,6 +95,7 @@ public: QString pattern() const; void setPattern(const QString &pattern); + [[nodiscard]] bool isValid() const; qsizetype patternErrorOffset() const; QString errorString() const; @@ -118,21 +119,25 @@ public: }; Q_DECLARE_FLAGS(MatchOptions, MatchOption) + [[nodiscard]] QRegularExpressionMatch match(const QString &subject, qsizetype offset = 0, MatchType matchType = NormalMatch, MatchOptions matchOptions = NoMatchOption) const; + [[nodiscard]] QRegularExpressionMatch match(QStringView subjectView, qsizetype offset = 0, MatchType matchType = NormalMatch, MatchOptions matchOptions = NoMatchOption) const; + [[nodiscard]] QRegularExpressionMatchIterator globalMatch(const QString &subject, qsizetype offset = 0, MatchType matchType = NormalMatch, MatchOptions matchOptions = NoMatchOption) const; + [[nodiscard]] QRegularExpressionMatchIterator globalMatch(QStringView subjectView, qsizetype offset = 0, MatchType matchType = NormalMatch,