1
2
3
4
5
6 #ifndef CPP2CM_CPP2CM_FILTER_INCLUDED
7 #define CPP2CM_CPP2CM_FILTER_INCLUDED
8 #include <cpp2cm/cpp2cm/File.hpp>
9 #include <soulng/rex/Nfa.hpp>
10
11 namespace cpp2cm {
12
13 class Filter
14 {
15 public:
16 enum class Type { include, exclude };
17 Filter(soulng::rex::Context& context_, Type type_, const std::u32string& pattern_);
18 void Apply(File& file);
19 private:
20 Type type;
21 std::u32string pattern;
22 soulng::rex::Nfa nfa;
23 };
24
25 class FilterList
26 {
27 public:
28 FilterList();
29 void Add(Filter& filter);
30 void Apply(File& file);
31 private:
32 std::vector<Filter> filters;
33 };
34
35 }
36
37 #endif // CPP2CM_CPP2CM_FILTER_INCLUDED