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