OLD | NEW |
(Empty) | |
| 1 #ifndef ADBLOCK_PLUS_ACTIVE_FILTER_H |
| 2 #define ADBLOCK_PLUS_ACTIVE_FILTER_H |
| 3 |
| 4 #include "Filter.h" |
| 5 #include "api.h" |
| 6 #include "StringMap.h" |
| 7 |
| 8 class ActiveFilter : public Filter |
| 9 { |
| 10 private: |
| 11 bool mIgnoreTrailingDot; |
| 12 typedef StringMap<bool> DomainMap; |
| 13 typedef StringSet SitekeySet; |
| 14 protected: |
| 15 std::unique_ptr<DomainMap> mDomains; |
| 16 std::unique_ptr<SitekeySet> mSitekeys; |
| 17 void ParseDomains(const String& str, char16_t separator); |
| 18 void AddSitekey(const String& sitekey); |
| 19 public: |
| 20 explicit ActiveFilter(const String& text, |
| 21 bool ignoreTrailingDot); |
| 22 FILTER_PROPERTY(bool, mDisabled, GetDisabled, SetDisabled); |
| 23 FILTER_PROPERTY(unsigned int, mHitCount, GetHitCount, SetHitCount); |
| 24 FILTER_PROPERTY(unsigned int, mLastHit, GetLastHit, SetLastHit); |
| 25 bool IsActiveOnDomain(String& docDomain, |
| 26 const String& sitekey) const; |
| 27 bool IsActiveOnlyOnDomain(String& docDomain) const; |
| 28 bool IsGeneric() const; |
| 29 String Serialize() const; |
| 30 }; |
| 31 |
| 32 #endif |
OLD | NEW |