Rudiments
|
#include <cronschedule.h>
Inherits object.
Public Member Functions | |
cronschedule () | |
~cronschedule () | |
bool | setSchedule (const char *when) |
bool | setSchedule (const char *years, const char *months, const char *daysofmonth, const char *daysofweek, const char *dayparts) |
bool | isInSchedule (datetime *dt) |
bool | isInSchedule (const char *dt) |
bool | clear () |
Public Member Functions inherited from object | |
virtual | ~object () |
The cronschedule class provides methods for parsing a cronish-style schedule string and determining whether a given date/time is in the schedule.
cronschedule::cronschedule | ( | ) |
Creates an instance of the cronschedule class.
cronschedule::~cronschedule | ( | ) |
Deletes this instance of the cronschedule class.
bool cronschedule::clear | ( | ) |
Clears any schedule previously set by setSchedule() such that any call to inSchedule() will return false.
Always returns true.
Returns true if "dt" falls within the schedule previously configured by setSchedule() or false otherwise.
Returns true if "dt" falls within the schedule previously configured by setSchedule() or false otherwise.
Parses "when", which should be a cronish-style expression, and configures this instance to represent that schedule.
The expression should consist of 5 space-delimited parts:
Or, for a complete example: 2022 1,3,3-5,7 * 1-5 10:00-11:30,13:30-15:30
Note that the day-part is different from standard cron or java-style cron, in that hours and minutes are specified together rather than separately.
Returns true on success and false if "when" is malformed.
bool cronschedule::setSchedule | ( | const char * | years, |
const char * | months, | ||
const char * | daysofmonth, | ||
const char * | daysofweek, | ||
const char * | dayparts ) |
Parses each of "years", "months", "daysofmonth", "daysofweek", and "dayparts", which should each be cron-style expressions, and configures this instance to represent that schedule.
"years"
"months"
"daysofmonth"
"daysofweek"
"dayparts"
Returns true on success and false if any of those parts are malformed.