Index: compiled/Filter.h |
=================================================================== |
new file mode 100644 |
--- /dev/null |
+++ b/compiled/Filter.h |
@@ -0,0 +1,52 @@ |
+#ifndef ADBLOCK_PLUS_FILTER_H |
+#define ADBLOCK_PLUS_FILTER_H |
+ |
+#include <memory> |
+#include <vector> |
+ |
+#include "String.h" |
+#include "debug.h" |
+ |
+class Filter; |
+ |
+typedef std::shared_ptr<Filter> FilterPtr; |
+ |
+class Filter : public std::enable_shared_from_this<Filter> |
+{ |
+protected: |
+ String mText; |
+ |
+public: |
+ explicit Filter(const String& text); |
+ virtual ~Filter() {} |
+ |
+ /* TODO |
+ std::vector<Subscription> subscriptions; |
+ */ |
+ |
+ const String GetText() const |
+ { |
+ return mText; |
+ } |
+ |
+ enum Type |
+ { |
+ UNKNOWN = 0, |
+ INVALID = 1, |
+ COMMENT = 2, |
+ BLOCKING = 3, |
+ WHITELIST = 4, |
+ ELEMHIDE = 5, |
+ ELEMHIDEEXCEPTION = 6, |
+ CSSPROPERTY = 7, |
+ }; |
+ |
+ virtual Type GetType() const = 0; |
+ |
+ virtual String Serialize(); |
+ |
+ static FilterPtr FromText(const String& text); |
+ static String Normalize(String& text); |
+}; |
+ |
+#endif |