31 typedef std::chrono::time_point<std::chrono::system_clock> t_time_pt;
32 typedef std::chrono::duration<unsigned long long> t_duration;
38 void init(
const std::string &path,
unsigned default_second_interval);
50 unsigned begin_time_hour;
51 unsigned begin_time_minute;
52 unsigned end_time_hour;
53 unsigned end_time_minute;
54 unsigned interval_between_frame_capture_seconds;
55 bool end_time_is_next_day;
64 static bool isInTimeRule(
const TimeRule &t,
const tm &now);
68 PARSE_RESULT_BAD_CHARS,
69 PARSE_RESULT_OUT_OF_BOUND,
73 static ParseResult stoi_err_handling(
unsigned& dst,
const std::string &src,
unsigned max_bound);
74 static bool parsing_contains_error(
const std::vector<ParseResult>& parse_res_list,
75 const std::vector<std::string>& str_list,
const std::string& curr_line,
76 unsigned line_number);
77 bool single_time_rule_parser(
const std::string &path,
const std::string &line,
78 unsigned line_number);
80 std::chrono::seconds default_duration_;
81 t_time_pt end_of_current_time_interval_;
82 t_duration current_time_interval_;
83 std::vector<TimeRule> rules_;