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::wstring text; |
| 16 |
| 17 public: |
| 18 explicit Filter(const std::wstring& text); |
| 19 |
| 20 /* TODO |
| 21 std::vector<Subscription> subscriptions; |
| 22 */ |
| 23 |
| 24 const std::wstring GetText() const |
| 25 { |
| 26 return text; |
| 27 } |
| 28 |
| 29 enum Type |
| 30 { |
| 31 UNKNOWN, |
| 32 INVALID, |
| 33 COMMENT, |
| 34 BLOCKING, |
| 35 WHITELIST, |
| 36 ELEMHIDE, |
| 37 ELEMHIDEEXCEPTION, |
| 38 CSSPROPERTY, |
| 39 }; |
| 40 |
| 41 virtual Type GetType() const = 0; |
| 42 |
| 43 virtual const std::wstring Serialize(); |
| 44 |
| 45 static FilterPtr FromText(const std::wstring& text); |
| 46 static const std::wstring Normalize(const std::wstring& text); |
| 47 }; |
| 48 |
| 49 #endif |
OLD | NEW |