windowrules: add negative: prefix for negating a regex

fixes #8799
This commit is contained in:
Vaxry 2024-12-21 23:07:23 +00:00
parent 57921d7dbd
commit 31422ae25d
5 changed files with 61 additions and 34 deletions

21
src/desktop/Rule.hpp Normal file
View file

@ -0,0 +1,21 @@
#pragma once
#include <memory>
//NOLINTNEXTLINE
namespace re2 {
class RE2;
};
class CRuleRegexContainer {
public:
CRuleRegexContainer() = default;
CRuleRegexContainer(const std::string& regex);
bool passes(const std::string& str) const;
private:
std::unique_ptr<re2::RE2> regex;
bool negative = false;
};