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

Side by Side Diff: compiled/ElemHideBase.h

Issue 29333474: Issue 4125 - [emscripten] Convert filter classes to C++ (Closed)
Patch Set: Merged filter parsing and normalization Created Feb. 4, 2016, 3:01 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/CommentFilter.cpp ('k') | compiled/ElemHideBase.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_ELEM_HIDE_BASE_H
2 #define ADBLOCK_PLUS_ELEM_HIDE_BASE_H
3
4 #include <cstddef>
5
6 #include "ActiveFilter.h"
7
8 struct ElemHideBaseData
9 {
10 String::size_type mDomainsEnd;
11 String::size_type mSelectorStart;
12
13 bool HasDomains() const
14 {
15 return mDomainsEnd != 0;
16 }
17
18 String GetDomainsSource(String& text) const
19 {
20 return String(text, 0, mDomainsEnd);
21 }
22
23 const String GetDomainsSource(const String& text) const
24 {
25 return String(text, 0, mDomainsEnd);
26 }
27
28 String GetSelector(String& text) const
29 {
30 return String(text, mSelectorStart);
31 }
32
33 const String GetSelector(const String& text) const
34 {
35 return String(text, mSelectorStart);
36 }
37 };
38
39 struct ElemHideData;
40
41 class ElemHideBase : public ActiveFilter, protected ElemHideBaseData
42 {
43 public:
44 ElemHideBase(const String& text, const ElemHideBaseData& data);
45 static Type Parse(String& text, ElemHideData& data);
46
47 EMSCRIPTEN_KEEPALIVE const String GetSelector() const
48 {
49 return ElemHideBaseData::GetSelector(mText);
50 }
51
52 EMSCRIPTEN_KEEPALIVE String GetSelectorDomain() const;
53 };
54
55 #endif
OLDNEW
« no previous file with comments | « compiled/CommentFilter.cpp ('k') | compiled/ElemHideBase.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld