workspaces: refactor class member vars (#10167)
This commit is contained in:
parent
0e80ecc534
commit
02d7badd15
37 changed files with 687 additions and 688 deletions
|
|
@ -6,17 +6,17 @@
|
|||
CRuleRegexContainer::CRuleRegexContainer(const std::string& regex_) {
|
||||
const bool NEGATIVE = regex_.starts_with("negative:");
|
||||
|
||||
negative = NEGATIVE;
|
||||
regex = makeUnique<RE2>(NEGATIVE ? regex_.substr(9) : regex_);
|
||||
m_negative = NEGATIVE;
|
||||
m_regex = makeUnique<RE2>(NEGATIVE ? regex_.substr(9) : regex_);
|
||||
|
||||
// TODO: maybe pop an error?
|
||||
if (!regex->ok())
|
||||
if (!m_regex->ok())
|
||||
Debug::log(ERR, "RuleRegexContainer: regex {} failed to parse!", regex_);
|
||||
}
|
||||
|
||||
bool CRuleRegexContainer::passes(const std::string& str) const {
|
||||
if (!regex)
|
||||
if (!m_regex)
|
||||
return false;
|
||||
|
||||
return RE2::FullMatch(str, *regex) != negative;
|
||||
return RE2::FullMatch(str, *m_regex) != m_negative;
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue