QRegularExpression: plaster some [[nodiscard]]

On some of the "most important" API.

Change-Id: I800b53bb7b9a95d0184f813e7ba501a7ebd485c0
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
This commit is contained in:
Giuseppe D'Angelo 2020-12-02 12:30:14 +01:00
parent 553d4ec464
commit 53b7cb1bd7

View File

@ -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,