26 typedef std::chrono::time_point<std::chrono::system_clock> t_time_pt;
27 typedef std::chrono::duration<unsigned long long> t_duration;
33 void init(
const std::string &path,
unsigned default_second_interval);
45 unsigned begin_time_hour;
46 unsigned begin_time_minute;
47 unsigned end_time_hour;
48 unsigned end_time_minute;
49 unsigned interval_between_frame_capture_seconds;
50 bool end_time_is_next_day;
59 static bool isInTimeRule(
const TimeRule &t,
const tm &now);
63 PARSE_RESULT_BAD_CHARS,
64 PARSE_RESULT_OUT_OF_BOUND,
68 static ParseResult stoi_err_handling(
unsigned& dst,
const std::string &src,
unsigned max_bound);
69 static bool parsing_contains_error(
const std::vector<ParseResult>& parse_res_list,
70 const std::vector<std::string>& str_list,
const std::string& curr_line,
71 unsigned line_number);
72 bool single_time_rule_parser(
const std::string &path,
const std::string &line,
73 unsigned line_number);
75 std::chrono::seconds default_duration_;
76 t_time_pt end_of_current_time_interval_;
77 t_duration current_time_interval_;
78 std::vector<TimeRule> rules_;