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: How with CSS property filters Created Jan. 20, 2016, 1:12 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 <memory>
5 #include <string>
6 #include <vector>
7
8 #include "debug.h"
9
10 class Filter;
11
12 typedef std::shared_ptr<Filter> FilterPtr;
13
14 class Filter : public std::enable_shared_from_this<Filter>
15 {
16 private:
17 std::u16string text;
18
19 public:
20 explicit Filter(const std::u16string& text);
21 virtual ~Filter() {}
22
23 /* TODO
24 std::vector<Subscription> subscriptions;
25 */
26
27 const std::u16string GetText() const
28 {
29 return text;
30 }
31
32 enum Type
33 {
34 UNKNOWN = 0,
35 INVALID = 1,
36 COMMENT = 2,
37 BLOCKING = 3,
38 WHITELIST = 4,
39 ELEMHIDE = 5,
40 ELEMHIDEEXCEPTION = 6,
41 CSSPROPERTY = 7,
42 };
43
44 virtual Type GetType() const = 0;
45
46 virtual const std::u16string Serialize();
47
48 static FilterPtr FromText(const std::u16string& text);
49 static const std::u16string Normalize(const std::u16string& text);
50 };
51
52 #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