OLD | NEW |
(Empty) | |
| 1 #ifndef ADBLOCK_PLUS_FILTER_H |
| 2 #define ADBLOCK_PLUS_FILTER_H |
| 3 |
| 4 #include <memory> |
| 5 #include <string> |
| 6 #include <vector> |
| 7 |
| 8 class Filter; |
| 9 |
| 10 typedef std::shared_ptr<Filter> FilterPtr; |
| 11 |
| 12 class Filter |
| 13 { |
| 14 private: |
| 15 std::u16string text; |
| 16 |
| 17 public: |
| 18 explicit Filter(const std::u16string& text); |
| 19 |
| 20 /* TODO |
| 21 std::vector<Subscription> subscriptions; |
| 22 */ |
| 23 |
| 24 const std::u16string GetText() const |
| 25 { |
| 26 return text; |
| 27 } |
| 28 |
| 29 enum Type |
| 30 { |
| 31 UNKNOWN = 0, |
| 32 INVALID = 1, |
| 33 COMMENT = 2, |
| 34 BLOCKING = 3, |
| 35 WHITELIST = 4, |
| 36 ELEMHIDE = 5, |
| 37 ELEMHIDEEXCEPTION = 6, |
| 38 CSSPROPERTY = 7, |
| 39 }; |
| 40 |
| 41 virtual Type GetType() const = 0; |
| 42 |
| 43 virtual const std::u16string Serialize(); |
| 44 |
| 45 static FilterPtr FromText(const std::u16string& text); |
| 46 static const std::u16string Normalize(const std::u16string& text); |
| 47 }; |
| 48 |
| 49 #endif |
OLD | NEW |