diff options
Diffstat (limited to 'lib/filter.h')
| -rw-r--r-- | lib/filter.h | 22 |
1 files changed, 21 insertions, 1 deletions
| diff --git a/lib/filter.h b/lib/filter.h index a12a822..942fe18 100644 --- a/lib/filter.h +++ b/lib/filter.h | |||
| @@ -14,7 +14,8 @@ namespace verbly { | |||
| 14 | enum class type { | 14 | enum class type { |
| 15 | empty, | 15 | empty, |
| 16 | singleton, | 16 | singleton, |
| 17 | group | 17 | group, |
| 18 | mask | ||
| 18 | }; | 19 | }; |
| 19 | 20 | ||
| 20 | enum class comparison { | 21 | enum class comparison { |
| @@ -106,6 +107,16 @@ namespace verbly { | |||
| 106 | 107 | ||
| 107 | const_iterator end() const; | 108 | const_iterator end() const; |
| 108 | 109 | ||
| 110 | // Mask | ||
| 111 | |||
| 112 | filter(std::string name, bool internal, filter subfilter); | ||
| 113 | |||
| 114 | const std::string& getMaskName() const; | ||
| 115 | |||
| 116 | bool isMaskInternal() const; | ||
| 117 | |||
| 118 | const filter& getMaskFilter() const; | ||
| 119 | |||
| 109 | // Negation | 120 | // Negation |
| 110 | 121 | ||
| 111 | filter operator!() const; | 122 | filter operator!() const; |
| @@ -118,6 +129,10 @@ namespace verbly { | |||
| 118 | filter& operator&=(filter condition); | 129 | filter& operator&=(filter condition); |
| 119 | filter& operator|=(filter condition); | 130 | filter& operator|=(filter condition); |
| 120 | 131 | ||
| 132 | // Maskifying | ||
| 133 | |||
| 134 | static filter mask(std::string name, filter subfilter); | ||
| 135 | |||
| 121 | // Utility | 136 | // Utility |
| 122 | 137 | ||
| 123 | filter normalize(object context) const; | 138 | filter normalize(object context) const; |
| @@ -141,6 +156,11 @@ namespace verbly { | |||
| 141 | std::list<filter> children; | 156 | std::list<filter> children; |
| 142 | bool orlogic; | 157 | bool orlogic; |
| 143 | } group_; | 158 | } group_; |
| 159 | struct { | ||
| 160 | std::string name; | ||
| 161 | bool internal; | ||
| 162 | std::unique_ptr<filter> subfilter; | ||
| 163 | } mask_; | ||
| 144 | }; | 164 | }; |
| 145 | type type_ = type::empty; | 165 | type type_ = type::empty; |
| 146 | 166 | ||
