Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code

Side by Side Diff: compiled/filter/Filter.h

Issue 29384812: Issue 4127 - [emscripten] Convert subscription classes to C++ - Part 1 (Closed) Base URL: https://hg.adblockplus.org/adblockpluscore
Patch Set: Created March 15, 2017, 3:05 p.m.
Left:
Right:
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View unified diff | Download patch
« no previous file with comments | « compiled/bindings.ipp ('k') | compiled/subscription/DownloadableSubscription.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 #pragma once 1 #pragma once
2 2
3 #include <vector> 3 #include <vector>
4 4
5 #include "../String.h" 5 #include "../String.h"
6 #include "../intrusive_ptr.h" 6 #include "../intrusive_ptr.h"
7 #include "../debug.h" 7 #include "../debug.h"
8 8
9 class Filter : public ref_counted 9 class Filter : public ref_counted
10 { 10 {
11 protected: 11 protected:
12 OwnedString mText; 12 OwnedString mText;
13 13
14 public: 14 public:
15 enum Type 15 enum Type
16 { 16 {
17 UNKNOWN = 0, 17 UNKNOWN = 0,
18 INVALID = 1, 18 INVALID = 1,
19 COMMENT = 2, 19 COMMENT = 2,
20 BLOCKING = 3, 20 BLOCKING = 3,
21 WHITELIST = 4, 21 WHITELIST = 4,
22 ELEMHIDE = 5, 22 ELEMHIDE = 5,
23 ELEMHIDEEXCEPTION = 6, 23 ELEMHIDEEXCEPTION = 6,
24 ELEMHIDEEMULATION = 7, 24 ELEMHIDEEMULATION = 7,
25 MAXTYPE = 7
25 }; 26 };
26 27
27 explicit Filter(Type type, const String& text); 28 explicit Filter(Type type, const String& text);
28 ~Filter(); 29 ~Filter();
29 30
30 Type mType; 31 Type mType;
31 32
32 /* TODO 33 /* TODO
33 std::vector<Subscription> mSubscriptions; 34 std::vector<Subscription> mSubscriptions;
34 */ 35 */
35 36
36 EMSCRIPTEN_KEEPALIVE const String& GetText() const 37 EMSCRIPTEN_KEEPALIVE const String& GetText() const
37 { 38 {
38 return mText; 39 return mText;
39 } 40 }
40 41
41 EMSCRIPTEN_KEEPALIVE OwnedString Serialize() const; 42 EMSCRIPTEN_KEEPALIVE OwnedString Serialize() const;
42 43
43 static EMSCRIPTEN_KEEPALIVE Filter* FromText(DependentString& text); 44 static EMSCRIPTEN_KEEPALIVE Filter* FromText(DependentString& text);
44 }; 45 };
45 46
46 typedef intrusive_ptr<Filter> FilterPtr; 47 typedef intrusive_ptr<Filter> FilterPtr;
OLDNEW
« no previous file with comments | « compiled/bindings.ipp ('k') | compiled/subscription/DownloadableSubscription.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld