int64_t parseDayOfWeek()

in bistro/cron/StandardCrontabItem.cpp [78:95]


int64_t parseDayOfWeek(const string& s) {
  if (s == "sun" || s == "sunday") {
    return 1;
  } else if (s == "mon" || s == "monday") {
    return 2;
  } else if (s == "tue" || s == "tuesday") {
    return 3;
  } else if (s == "wed" || s == "wednesday") {
    return 4;
  } else if (s == "thu" || s == "thursday") {
    return 5;
  } else if (s == "fri" || s == "friday") {
    return 6;
  } else if (s == "sat" || s == "saturday") {
    return 7;
  }
  throw std::runtime_error("Unknown day of week: " + s);
}