OLD | NEW |
(Empty) | |
| 1 #ifndef ADBLOCK_PLUS_ACTIVE_FILTER_H |
| 2 #define ADBLOCK_PLUS_ACTIVE_FILTER_H |
| 3 |
| 4 #include <string> |
| 5 #include <unordered_map> |
| 6 #include <unordered_set> |
| 7 |
| 8 #include "Filter.h" |
| 9 #include "api.h" |
| 10 |
| 11 class ActiveFilter : public Filter |
| 12 { |
| 13 private: |
| 14 bool ignoreTrailingDot; |
| 15 protected: |
| 16 std::unordered_map<std::u16string,bool> domains; |
| 17 std::unordered_set<std::u16string> sitekeys; |
| 18 void ParseDomains(const std::u16string& str, char16_t separator); |
| 19 public: |
| 20 explicit ActiveFilter(const std::u16string& text, |
| 21 bool ignoreTrailingDot); |
| 22 FILTER_PROPERTY(bool, disabled, GetDisabled, SetDisabled); |
| 23 FILTER_PROPERTY(unsigned int, hitCount, GetHitCount, SetHitCount); |
| 24 FILTER_PROPERTY(unsigned int, lastHit, GetLastHit, SetLastHit); |
| 25 bool IsActiveOnDomain(const std::u16string& docDomain, |
| 26 const std::u16string& sitekey); |
| 27 bool IsActiveOnlyOnDomain(const std::u16string& docDomain); |
| 28 bool IsGeneric(); |
| 29 const std::u16string Serialize(); |
| 30 }; |
| 31 |
| 32 #endif |
OLD | NEW |