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