OLD | NEW |
1 #pragma once | 1 #pragma once |
2 | 2 |
3 #include <cstddef> | 3 #include <cstddef> |
4 | 4 |
5 #include "ActiveFilter.h" | 5 #include "ActiveFilter.h" |
6 | 6 |
7 struct ElemHideBaseData | 7 struct ElemHideData |
8 { | 8 { |
9 String::size_type mDomainsEnd; | 9 String::size_type mDomainsEnd; |
10 String::size_type mSelectorStart; | 10 String::size_type mSelectorStart; |
11 | 11 |
12 bool HasDomains() const | 12 bool HasDomains() const |
13 { | 13 { |
14 return mDomainsEnd != 0; | 14 return mDomainsEnd != 0; |
15 } | 15 } |
16 | 16 |
17 DependentString GetDomainsSource(String& text) const | 17 DependentString GetDomainsSource(String& text) const |
(...skipping 10 matching lines...) Expand all Loading... |
28 { | 28 { |
29 return DependentString(text, mSelectorStart); | 29 return DependentString(text, mSelectorStart); |
30 } | 30 } |
31 | 31 |
32 const DependentString GetSelector(const String& text) const | 32 const DependentString GetSelector(const String& text) const |
33 { | 33 { |
34 return DependentString(text, mSelectorStart); | 34 return DependentString(text, mSelectorStart); |
35 } | 35 } |
36 }; | 36 }; |
37 | 37 |
38 struct ElemHideData; | |
39 | |
40 class ElemHideBase : public ActiveFilter | 38 class ElemHideBase : public ActiveFilter |
41 { | 39 { |
42 protected: | 40 protected: |
43 ElemHideBaseData mData; | 41 ElemHideData mData; |
44 public: | 42 public: |
45 explicit ElemHideBase(Type type, const String& text, const ElemHideBaseData& d
ata); | 43 explicit ElemHideBase(Type type, const String& text, const ElemHideData& data)
; |
46 static Type Parse(DependentString& text, ElemHideData& data); | 44 static Type Parse(DependentString& text, ElemHideData& data); |
47 | 45 |
48 EMSCRIPTEN_KEEPALIVE const DependentString GetSelector() const | 46 EMSCRIPTEN_KEEPALIVE const DependentString GetSelector() const |
49 { | 47 { |
50 return mData.GetSelector(mText); | 48 return mData.GetSelector(mText); |
51 } | 49 } |
52 | 50 |
53 EMSCRIPTEN_KEEPALIVE OwnedString GetSelectorDomain() const; | 51 EMSCRIPTEN_KEEPALIVE OwnedString GetSelectorDomain() const; |
54 }; | 52 }; |
OLD | NEW |