#ifndef REGEXMANAGER__H #define REGEXMANAGER__H #include #include #include #include #include #include #include namespace newsbeuter { class regexmanager : public config_action_handler { public: regexmanager(); ~regexmanager(); virtual void handle_action(const std::string& action, const std::vector& params); virtual void dump_config(std::vector& config_output); void quote_and_highlight(std::string& str, const std::string& location); void remove_last_regex(const std::string& location); int article_matches(matchable * item); private: typedef std::pair, std::vector> rc_pair; std::map locations; std::vector cheat_store_for_dump_config; std::vector, int>> matchers; std::string extract_initial_marker(const std::string& str); public: inline std::vector& get_attrs(const std::string& loc) { return locations[loc].second; } inline std::vector& get_regexes(const std::string& loc) { return locations[loc].first; } }; } #endif