#ifndef NEWSBOAT_FILTERCONTAINER_H_ #define NEWSBOAT_FILTERCONTAINER_H_ #include "configactionhandler.h" #include "3rd-party/optional.hpp" namespace newsboat { /// Stores the name of the filter and the filter expression that user added via /// `define-filter` configuration option struct FilterNameExprPair { /// Name of the filter std::string name; /// Filter expression for this named filter std::string expr; }; class FilterContainer : public ConfigActionHandler { public: FilterContainer() = default; ~FilterContainer() override; void handle_action(const std::string& action, const std::vector& params) override; void dump_config(std::vector& config_output) const override; std::vector& get_filters() { return filters; } unsigned int size() { return filters.size(); } nonstd::optional get_filter(const std::string& name); private: std::vector filters; }; } // namespace newsboat #endif /* NEWSBOAT_FILTERCONTAINER_H_ */