config: allow negative to be used with tags. (#11779)
This commit is contained in:
parent
4f3dd1ddb4
commit
ae445606e2
2 changed files with 52 additions and 1 deletions
|
|
@ -1,7 +1,10 @@
|
|||
#include "TagKeeper.hpp"
|
||||
|
||||
bool CTagKeeper::isTagged(const std::string& tag, bool strict) {
|
||||
return m_tags.contains(tag) || (!strict && m_tags.contains(tag + "*"));
|
||||
const bool NEGATIVE = tag.starts_with("negative");
|
||||
const auto MATCH = NEGATIVE ? tag.substr(9) : tag;
|
||||
const bool TAGGED = m_tags.contains(MATCH) || (!strict && m_tags.contains(MATCH + "*"));
|
||||
return NEGATIVE ? !TAGGED : TAGGED;
|
||||
}
|
||||
|
||||
bool CTagKeeper::applyTag(const std::string& tag, bool dynamic) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue