6 #include <QRegularExpression> 8 #include <pajlada/serialize.hpp> 19 return std::tie(this->pattern_, this->isRegex_) ==
20 std::tie(other.pattern_, other.isRegex_);
26 , regex_(
isRegex ? pattern :
"",
27 QRegularExpression::CaseInsensitiveOption |
28 QRegularExpression::UseUnicodePropertiesOption)
34 return this->pattern_;
39 return this->isRegex_;
44 return this->
isRegex() && this->regex_.isValid();
47 bool isMatch(
const QString &subject)
const 53 return this->regex_.match(subject).hasMatch();
59 return subject.toLower() == this->pattern_.toLower();
65 QRegularExpression regex_;
75 rapidjson::Document::AllocatorType &a)
77 rapidjson::Value ret(rapidjson::kObjectType);
89 bool *error =
nullptr)
94 if (!value.IsObject())
96 PAJLADA_REPORT_ERROR(error)
bool operator==(const HighlightBlacklistUser &other) const
Definition: HighlightBlacklistUser.hpp:17
Definition: HighlightBlacklistUser.hpp:14
bool isRegex() const
Definition: HighlightBlacklistUser.hpp:37
Definition: Application.cpp:48
HighlightBlacklistUser(const QString &pattern, bool isRegex=false)
Definition: HighlightBlacklistUser.hpp:23
bool isMatch(const QString &subject) const
Definition: HighlightBlacklistUser.hpp:47
void set(rapidjson::Value &obj, const char *key, const Type &value, rapidjson::Document::AllocatorType &a)
Definition: RapidjsonHelpers.hpp:22
Definition: Command.hpp:25
bool getSafe(const rapidjson::Value &obj, const char *key, Type &out)
Definition: RapidjsonHelpers.hpp:73
bool isValidRegex() const
Definition: HighlightBlacklistUser.hpp:42
const QString & getPattern() const
Definition: HighlightBlacklistUser.hpp:32