blob: dce190e594a4ab7014dd3b68e3e9af087816e129 (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
|
#ifndef NEWSBOAT_RSSIGNORES_H_
#define NEWSBOAT_RSSIGNORES_H_
#include <string>
#include <unordered_map>
#include <vector>
#include "configactionhandler.h"
#include "matcher.h"
#include "rssitem.h"
namespace newsboat {
typedef std::pair<std::string, std::shared_ptr<Matcher>> FeedUrlExprPair;
class RssIgnores : public ConfigActionHandler {
public:
RssIgnores() {}
~RssIgnores() override {}
void handle_action(const std::string& action,
const std::vector<std::string>& params) override;
void dump_config(std::vector<std::string>& config_output) const override;
bool matches(RssItem* item);
bool matches_lastmodified(const std::string& url);
bool matches_resetunread(const std::string& url);
private:
bool matches_expr(std::shared_ptr<Matcher> expr, RssItem* item);
std::vector<FeedUrlExprPair> regex_ignores;
std::unordered_multimap<std::string, std::shared_ptr<Matcher>> non_regex_ignores;
std::vector<std::string> ignores_lastmodified;
std::vector<std::string> resetflag;
static const std::string REGEX_PREFIX;
};
} // namespace newsboat
#endif /* NEWSBOAT_RSSIGNORES_H_ */
|