1
2
3
4
5
6 #ifndef CPP2CM_CPP2CM_NOTHROW_LIST_INCLUDED
7 #define CPP2CM_CPP2CM_NOTHROW_LIST_INCLUDED
8 #include <soulng/rex/Nfa.hpp>
9 #include <string>
10
11 namespace cpp2cm {
12
13 struct Item
14 {
15 enum class Type { none, file, class_, function };
16 Item(Type type_, const std::u32string& text_, bool default_);
17 Type type;
18 std::u32string text;
19 bool include;
20 };
21
22 struct NothrowPattern
23 {
24 enum class Kind { include, exclude };
25 NothrowPattern(soulng::rex::Context& context_, Kind kind_, Item::Type type_, const std::u32string& pattern_);
26 void ApplyTo(Item& item);
27 Kind kind;
28 Item::Type type;
29 std::u32string pattern;
30 soulng::rex::Nfa nfa;
31 };
32
33 class NothrowList
34 {
35 public:
36 NothrowList(bool verbose_);
37 void AddPattern(const NothrowPattern& pattern);
38 void ApplyTo(Item& item);
39 bool Verbose() const { return verbose; }
40 private:
41 bool verbose;
42 std::vector<NothrowPattern> patterns;
43 };
44
45 }
46
47 #endif // CPP2CM_CPP2CM_NOTHROW_LIST_INCLUDED