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: Split up String class into two, cleaned up RegExpFilter methods Created Feb. 4, 2016, 7:20 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 DependentString GetDomainsSource(String& text) const
19 {
20 return DependentString(text, 0, mDomainsEnd);
21 }
22
23 const DependentString GetDomainsSource(const String& text) const
24 {
25 return DependentString(text, 0, mDomainsEnd);
26 }
27
28 DependentString GetSelector(String& text) const
29 {
30 return DependentString(text, mSelectorStart);
31 }
32
33 const DependentString GetSelector(const String& text) const
34 {
35 return DependentString(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(DependentString& text, ElemHideData& data);
46
47 EMSCRIPTEN_KEEPALIVE const DependentString GetSelector() const
48 {
49 return ElemHideBaseData::GetSelector(mText);
50 }
51
52 EMSCRIPTEN_KEEPALIVE OwnedString 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