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

Side by Side Diff: compiled/Filter.h

Issue 29333474: Issue 4125 - [emscripten] Convert filter classes to C++ (Closed)
Patch Set: Replaced shared_ptr by boost-like intrusive_ptr Created Jan. 28, 2016, 7:50 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/ElemHideFilter.cpp ('k') | compiled/Filter.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 #ifndef ADBLOCK_PLUS_FILTER_H
2 #define ADBLOCK_PLUS_FILTER_H
3
4 #include <vector>
5
6 #include "String.h"
7 #include "intrusive_ptr.h"
8 #include "debug.h"
9
10 class Filter : public ref_counted
11 {
12 protected:
13 String mText;
14
15 public:
16 explicit Filter(const String& text);
17 virtual ~Filter();
18
19 /* TODO
20 std::vector<Subscription> subscriptions;
21 */
22
23 const String GetText() const
24 {
25 return mText;
26 }
27
28 enum Type
29 {
30 UNKNOWN = 0,
31 INVALID = 1,
32 COMMENT = 2,
33 BLOCKING = 3,
34 WHITELIST = 4,
35 ELEMHIDE = 5,
36 ELEMHIDEEXCEPTION = 6,
37 CSSPROPERTY = 7,
38 };
39
40 virtual Type GetType() const = 0;
41
42 virtual String Serialize() const;
43
44 static Filter* FromText(const String& text);
45 static String Normalize(String& text);
46 };
47
48 typedef intrusive_ptr<Filter> FilterPtr;
49
50 #endif
OLDNEW
« no previous file with comments | « compiled/ElemHideFilter.cpp ('k') | compiled/Filter.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld