Index: compiled/filter/ActiveFilter.h |
=================================================================== |
--- a/compiled/filter/ActiveFilter.h |
+++ b/compiled/filter/ActiveFilter.h |
@@ -37,24 +37,45 @@ |
name = value;\ |
if (FilterNotifier::Topic::topic != FilterNotifier::Topic::NONE)\ |
{\ |
FilterNotifier::FilterChange(FilterNotifier::Topic::topic, *this);\ |
}\ |
}\ |
} |
+struct ParsedDomains |
+{ |
+ struct Domain { |
+ String::size_type pos; |
+ String::size_type len; |
+ bool reverse; |
+ }; |
+ bool hasIncludes; |
+ bool hasEmpty; |
+ std::vector<Domain> domains; |
+ |
+ ParsedDomains() |
+ : hasIncludes(false), hasEmpty(false) |
+ { |
+ } |
+}; |
+ |
class ActiveFilter : public Filter |
{ |
public: |
typedef StringMap<bool> DomainMap; |
virtual DomainMap* GetDomains() const; |
protected: |
typedef StringSet SitekeySet; |
- void ParseDomains(const String& domains, String::value_type separator) const; |
+ static ParsedDomains ParseDomainsInternal(const String& domains, |
+ String::value_type separator, bool ignoreTrailingDot); |
+ void FillDomains(const String& domains, const ParsedDomains& parsed) const; |
+ void ParseDomains(const String& domains, |
+ String::value_type separator, bool ignoreTrailingDot) const; |
void AddSitekey(const String& sitekey) const; |
virtual SitekeySet* GetSitekeys() const; |
mutable std::unique_ptr<DomainMap> mDomains; |
mutable std::unique_ptr<SitekeySet> mSitekeys; |
private: |
bool mIgnoreTrailingDot; |
public: |
static constexpr Type classType = Type::ACTIVE; |