From 68da62a64cd65a8b28dcfe61b2174e55a47b7517 Mon Sep 17 00:00:00 2001 From: Aqua-sama Date: Tue, 14 Apr 2020 22:09:01 +0300 Subject: Add some FilterList tests --- staging/adblock/rule.h | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) (limited to 'staging/adblock/rule.h') diff --git a/staging/adblock/rule.h b/staging/adblock/rule.h index 03970dc..90062ba 100644 --- a/staging/adblock/rule.h +++ b/staging/adblock/rule.h @@ -45,7 +45,8 @@ public: enum MatchPosition { UrlStartsWith, UrlEndsWith, - UrlContains + UrlContains, + UrlEquals }; MatcherRule(const QString &pattern, const Options &opt, const MatchPosition pos = UrlContains) @@ -58,6 +59,9 @@ public: explicit MatcherRule(const MatcherRule &) = delete; MatcherRule &operator=(const MatcherRule &) = delete; + explicit MatcherRule(MatcherRule &&) = delete; + MatcherRule &operator=(MatcherRule &&) = delete; + ~MatcherRule() = default; bool hasMatch(const QStringRef &url) const override { @@ -70,6 +74,8 @@ public: return (index == url.length() - patternLength); case UrlContains: return (index != -1); + case UrlEquals: + return (index == 0 && patternLength == url.length()); } } @@ -93,6 +99,9 @@ public: explicit RegexRule(const RegexRule &) = delete; RegexRule &operator=(const RegexRule &) = delete; + explicit RegexRule(RegexRule &&) = delete; + RegexRule &operator=(RegexRule &&) = delete; + ~RegexRule() = default; bool hasMatch(const QStringRef &url) const override { -- cgit v1.2.1