OLD | NEW |
(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 |
OLD | NEW |