diff options
author | Aqua-sama <aqua@iserlohn-fortress.net> | 2018-10-18 14:40:32 +0200 |
---|---|---|
committer | Aqua-sama <aqua@iserlohn-fortress.net> | 2018-10-18 14:40:32 +0200 |
commit | 9ab6f6d363f873f0799982c3c0872d38a656ee84 (patch) | |
tree | bf7fba76f36be8d6560fa5914404ae4fb44711ad /lib/urlfilter/filtertree.h | |
parent | buildconfig: don't overwrite install prefix by default (diff) | |
download | smolbote-9ab6f6d363f873f0799982c3c0872d38a656ee84.tar.xz |
urlfilter: add Domain class
(#6): Add domain matcher class
Diffstat (limited to 'lib/urlfilter/filtertree.h')
-rw-r--r-- | lib/urlfilter/filtertree.h | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/lib/urlfilter/filtertree.h b/lib/urlfilter/filtertree.h index 8cecf50..004cf5a 100644 --- a/lib/urlfilter/filtertree.h +++ b/lib/urlfilter/filtertree.h @@ -14,6 +14,7 @@ #include <vector> #include <QIODevice> #include "filterleaf.h" +#include "domain.h" /** FilterTree: B+ tree of filter rules * The root of the tree contains branches that represent domains, on which their rules are to be applied. @@ -31,10 +32,16 @@ public: private: struct Branch { + explicit Branch(const QString &host) : domain(host) {} + explicit Branch(Branch &&other) + : domain(std::move(other.domain)) + , leaves(std::move(other.leaves)) + {} ~Branch() { qDeleteAll(leaves); } // TODO: replace domain type with domain-matching class - std::string domain; + Domain domain; + //std::string domain; std::vector<FilterLeaf *> leaves; }; |