Index: compiled/Filter.h |
=================================================================== |
new file mode 100644 |
--- /dev/null |
+++ b/compiled/Filter.h |
@@ -0,0 +1,52 @@ |
+#pragma once |
+ |
+#include <vector> |
+ |
+#include "String.h" |
+#include "intrusive_ptr.h" |
+#include "debug.h" |
+ |
+class Filter : public ref_counted |
+{ |
+protected: |
+ OwnedString mText; |
+ |
+public: |
+ explicit Filter(const String& text); |
+ virtual ~Filter(); |
+ |
+ /* TODO |
+ std::vector<Subscription> subscriptions; |
+ */ |
+ |
+ EMSCRIPTEN_KEEPALIVE const DependentString 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; |
+ |
+ EMSCRIPTEN_KEEPALIVE OwnedString Serialize() const; |
+ |
+ static EMSCRIPTEN_KEEPALIVE Type GetType(Filter* filter) |
+ { |
+ return filter->GetType(); |
+ } |
+ |
+ static EMSCRIPTEN_KEEPALIVE Filter* FromText(DependentString& text); |
+ static EMSCRIPTEN_KEEPALIVE Filter* GetKnownFilter(const String& text); |
+}; |
+ |
+typedef intrusive_ptr<Filter> FilterPtr; |