| 33 | } |
| 34 | |
| 35 | bool CronScheduler::IsMatch(const tm *tm) const { |
| 36 | bool minute_match = minute.IsMatch(tm->tm_min); |
| 37 | bool hour_match = hour.IsMatch(tm->tm_hour); |
| 38 | bool mday_match = mday.IsMatch(tm->tm_mday, 1); |
| 39 | bool month_match = month.IsMatch(tm->tm_mon + 1, 1); |
| 40 | bool wday_match = wday.IsMatch(tm->tm_wday); |
| 41 | |
| 42 | return minute_match && hour_match && mday_match && month_match && wday_match; |
| 43 | } |
| 44 | |
| 45 | StatusOr<CronScheduler> CronScheduler::Parse(std::string_view minute, std::string_view hour, std::string_view mday, |
| 46 | std::string_view month, std::string_view wday) { |