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: Using embind Created Jan. 15, 2016, 8:44 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 class Filter;
9
10 typedef std::shared_ptr<Filter> FilterPtr;
11
12 class Filter
13 {
14 private:
15 std::wstring text;
16
17 public:
18 explicit Filter(const std::wstring& text);
19
20 /* TODO
21 std::vector<Subscription> subscriptions;
22 */
23
24 const std::wstring GetText() const
25 {
26 return text;
27 }
28
29 enum Type
30 {
31 UNKNOWN,
32 INVALID,
33 COMMENT,
34 BLOCKING,
35 WHITELIST,
36 ELEMHIDE,
37 ELEMHIDEEXCEPTION,
38 CSSPROPERTY,
39 };
40
41 virtual Type GetType() const = 0;
42
43 virtual const std::wstring Serialize();
44
45 static FilterPtr FromText(const std::wstring& text);
46 static const std::wstring Normalize(const std::wstring& text);
47 };
48
49 #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