-
Notifications
You must be signed in to change notification settings - Fork 0
/
error_flag.h
116 lines (95 loc) · 4.68 KB
/
error_flag.h
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
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
#ifndef ERROR_FLAG_H
#define ERROR_FLAG_H
#include <string>
#include <vector>
class ErrorFlag {
public:
// The default values for these flags are false
bool err_redundant_identical_ctrl_arg;
bool err_redundant_total_pull_time_ctrl_arg;
bool err_invalid_value_for_total_pull_time_ctrl_arg;
bool err_invalid_value_for_total_pull_time_long_name_ctrl_arg;
bool err_missing_value_for_total_pull_time_ctrl_arg;
bool err_missing_value_for_total_pull_time_long_name_ctrl_arg;
bool err_redundant_pity_ctrl_arg;
bool err_invalid_value_for_pity_ctrl_arg;
bool err_invalid_value_for_pity_long_name_ctrl_arg;
bool err_missing_value_for_pity_ctrl_arg;
bool err_missing_value_for_pity_long_name_ctrl_arg;
bool err_redundant_num_rate_up_ctrl_arg;
bool err_invalid_value_for_num_rate_up_ctrl_arg;
bool err_invalid_value_for_num_rate_up_long_name_ctrl_arg;
bool err_missing_value_for_num_rate_up_ctrl_arg;
bool err_missing_value_for_num_rate_up_long_name_ctrl_arg;
bool err_redundant_current_pull_ctrl_arg;
bool err_invalid_value_for_current_pull_ctrl_arg;
bool err_invalid_value_for_current_pull_long_name_ctrl_arg;
bool err_missing_value_for_current_pull_ctrl_arg;
bool err_missing_value_for_current_pull_long_name_ctrl_arg;
bool err_conflict_ctrl_arg_flag;
bool err_unexpected_value_for_ctrl_arg_limited;
bool err_unexpected_value_for_ctrl_arg_standard;
bool err_unexpected_arguments_at_the_beginning;
bool err_help_ctrl_arg_with_other_args;
bool err_invalid_ctrl_args;
std::vector<std::string> invalid_ctrl_args_list;
ErrorFlag()
: err_redundant_identical_ctrl_arg(false),
err_redundant_total_pull_time_ctrl_arg(false),
err_invalid_value_for_total_pull_time_ctrl_arg(false),
err_invalid_value_for_total_pull_time_long_name_ctrl_arg(false),
err_missing_value_for_total_pull_time_ctrl_arg(false),
err_missing_value_for_total_pull_time_long_name_ctrl_arg(false),
err_redundant_pity_ctrl_arg(false),
err_invalid_value_for_pity_ctrl_arg(false),
err_invalid_value_for_pity_long_name_ctrl_arg(false),
err_missing_value_for_pity_ctrl_arg(false),
err_missing_value_for_pity_long_name_ctrl_arg(false),
err_redundant_num_rate_up_ctrl_arg(false),
err_invalid_value_for_num_rate_up_ctrl_arg(false),
err_invalid_value_for_num_rate_up_long_name_ctrl_arg(false),
err_missing_value_for_num_rate_up_ctrl_arg(false),
err_missing_value_for_num_rate_up_long_name_ctrl_arg(false),
err_redundant_current_pull_ctrl_arg(false),
err_invalid_value_for_current_pull_ctrl_arg(false),
err_invalid_value_for_current_pull_long_name_ctrl_arg(false),
err_missing_value_for_current_pull_ctrl_arg(false),
err_missing_value_for_current_pull_long_name_ctrl_arg(false),
err_conflict_ctrl_arg_flag(false),
err_unexpected_value_for_ctrl_arg_limited(false),
err_unexpected_value_for_ctrl_arg_standard(false),
err_unexpected_arguments_at_the_beginning(false),
err_help_ctrl_arg_with_other_args(false),
err_invalid_ctrl_args(false) {}
// Return true if any kinds of error occurs
bool check_err() const {
return err_redundant_identical_ctrl_arg ||
err_redundant_total_pull_time_ctrl_arg ||
err_invalid_value_for_total_pull_time_ctrl_arg ||
err_invalid_value_for_total_pull_time_long_name_ctrl_arg ||
err_missing_value_for_total_pull_time_ctrl_arg ||
err_missing_value_for_total_pull_time_long_name_ctrl_arg ||
err_redundant_pity_ctrl_arg ||
err_invalid_value_for_pity_ctrl_arg ||
err_invalid_value_for_pity_long_name_ctrl_arg ||
err_missing_value_for_pity_ctrl_arg ||
err_missing_value_for_pity_long_name_ctrl_arg ||
err_redundant_num_rate_up_ctrl_arg ||
err_invalid_value_for_num_rate_up_ctrl_arg ||
err_invalid_value_for_num_rate_up_long_name_ctrl_arg ||
err_missing_value_for_num_rate_up_ctrl_arg ||
err_missing_value_for_num_rate_up_long_name_ctrl_arg ||
err_redundant_current_pull_ctrl_arg ||
err_invalid_value_for_current_pull_ctrl_arg ||
err_invalid_value_for_current_pull_long_name_ctrl_arg ||
err_missing_value_for_current_pull_ctrl_arg ||
err_missing_value_for_current_pull_long_name_ctrl_arg ||
err_conflict_ctrl_arg_flag ||
err_unexpected_value_for_ctrl_arg_limited ||
err_unexpected_value_for_ctrl_arg_standard ||
err_unexpected_arguments_at_the_beginning ||
err_help_ctrl_arg_with_other_args ||
err_invalid_ctrl_args;
}
};
#endif // ERROR_FLAG_H