Index: compiled/Filter.h |
=================================================================== |
new file mode 100644 |
--- /dev/null |
+++ b/compiled/Filter.h |
@@ -0,0 +1,51 @@ |
+#pragma once |
+ |
+#include <vector> |
+ |
+#include "String.h" |
+#include "intrusive_ptr.h" |
+#include "debug.h" |
+ |
+class Filter : public ref_counted |
+{ |
+protected: |
+ OwnedString mText; |
+ |
+public: |
+ enum Type |
+ { |
+ UNKNOWN = 0, |
+ INVALID = 1, |
+ COMMENT = 2, |
+ BLOCKING = 3, |
+ WHITELIST = 4, |
+ ELEMHIDE = 5, |
+ ELEMHIDEEXCEPTION = 6, |
+ CSSPROPERTY = 7, |
+ }; |
+ |
+ explicit Filter(Type type, const String& text); |
sergei
2017/01/10 15:57:46
Just observation:
Before C++11 the compiler was al
Wladimir Palant
2017/03/13 17:42:03
I see. Here it rather seems to be a left-over from
|
+ virtual ~Filter(); |
sergei
2017/01/10 15:57:48
I'm not sure that we need to say virtual here beca
Wladimir Palant
2017/03/13 17:42:08
Done.
|
+ |
+ Type mType; |
sergei
2017/01/10 15:57:44
I guess it's a public member only for the sake of
Wladimir Palant
2017/03/13 17:42:06
Yes, we were calling a function originally in orde
|
+ |
+ /* TODO |
+ std::vector<Subscription> mSubscriptions; |
+ */ |
+ |
+ EMSCRIPTEN_KEEPALIVE const String& GetText() const |
+ { |
+ return mText; |
+ } |
+ |
+ EMSCRIPTEN_KEEPALIVE OwnedString Serialize() const; |
+ |
+ static EMSCRIPTEN_KEEPALIVE Type GetType(Filter* filter) |
sergei
2017/01/10 15:57:42
It seems we don't need this method anymore.
Wladimir Palant
2017/03/13 17:42:01
Done.
|
+ { |
+ return filter->mType; |
+ } |
+ |
+ static EMSCRIPTEN_KEEPALIVE Filter* FromText(DependentString& text); |
+}; |
+ |
+typedef intrusive_ptr<Filter> FilterPtr; |