diff options
Diffstat (limited to 'staging/hostlist/filterlist.hpp')
-rw-r--r-- | staging/hostlist/filterlist.hpp | 43 |
1 files changed, 43 insertions, 0 deletions
diff --git a/staging/hostlist/filterlist.hpp b/staging/hostlist/filterlist.hpp new file mode 100644 index 0000000..24243e5 --- /dev/null +++ b/staging/hostlist/filterlist.hpp @@ -0,0 +1,43 @@ +/* + * This file is part of smolbote. It's copyrighted by the contributors recorded + * in the version control history of the file, available from its original + * location: https://library.iserlohn-fortress.net/aqua/smolbote.git + * + * SPDX-License-Identifier: GPL-3.0 + */ + +#pragma once + +#include <map> +#include <smolbote/filterinterface.hpp> + +namespace Hostlist +{ + +class Filterlist final : public Filter +{ +public: + Filterlist() = default; + ~Filterlist() = default; + + [[nodiscard]] bool filter(QWebEngineUrlRequestInfo &info) const + { + return false; + } + [[nodiscard]] bool isUpToDate() const + { + return true; + } + + typedef uint DomainHash; + struct Rule { + QString domain; + QString redirect; + }; + + [[nodiscard]] static std::map<DomainHash, Rule> parseRule(const QString &line); + +private: + std::map<DomainHash, Rule> rules; +}; +} // namespace Hostlist |