LocalTimeRK
|
Class for managing a mask value of zero or more days of the week. More...
#include <LocalTimeRK.h>
Public Member Functions | |
LocalTimeDayOfWeek () | |
Default constructor with no days of week set. | |
LocalTimeDayOfWeek (uint8_t mask) | |
Sets days of weeks with a bit mask of days. More... | |
LocalTimeDayOfWeek & | withWeekdays () |
Convenience fluent setter to set all weekdays (Monday - Friday) More... | |
LocalTimeDayOfWeek & | withWeekends () |
Convenience fluent setter to set weekend days (Saturday and Sunday) More... | |
LocalTimeDayOfWeek & | withAllDays () |
Convenience fluent setter to set all days. More... | |
bool | isSet (int dayOfWeek) const |
Returns true if the specified dayOfWeek is set in the mask. More... | |
bool | isSet (LocalTimeYMD ymd) const |
return true if ymd is a day set in this object More... | |
bool | isEmpty () const |
Returns true if no days of the week are set in this object. More... | |
uint8_t | getMask () const |
Get the current mask value. More... | |
void | setMask (uint8_t mask) |
Set the mask value. More... | |
String | toString () const |
Converts this object to a human-readable string. More... | |
bool | operator== (const LocalTimeDayOfWeek &other) const |
Tests if this object has the same mask as other. More... | |
bool | operator!= (const LocalTimeDayOfWeek &other) const |
Tests if this object does not have the same mask as other. More... | |
Data Fields | |
uint8_t | dayOfWeekMask = 0 |
Mask value for this object. | |
Static Public Attributes | |
static const int | DAY_SUNDAY = 0 |
static const int | DAY_MONDAY = 1 |
static const int | DAY_TUESDAY = 2 |
static const int | DAY_WEDNESDAY = 3 |
static const int | DAY_THURSDAY = 4 |
static const int | DAY_FRIDAY = 5 |
static const int | DAY_SATURDAY = 6 |
static const uint8_t | MASK_SUNDAY = 0x01 |
Mask value for Sunday. | |
static const uint8_t | MASK_MONDAY = 0x02 |
Mask value for Monday. | |
static const uint8_t | MASK_TUESDAY = 0x04 |
Mask value for Tuesday. | |
static const uint8_t | MASK_WEDNESDAY = 0x08 |
Mask value for Wednesday. | |
static const uint8_t | MASK_THURSDAY = 0x10 |
Mask value for Thursday. | |
static const uint8_t | MASK_FRIDAY = 0x20 |
Mask value for Friday. | |
static const uint8_t | MASK_SATURDAY = 0x40 |
Mask value for Saturday. | |
static const uint8_t | MASK_ALL = MASK_SUNDAY | MASK_MONDAY | MASK_TUESDAY | MASK_WEDNESDAY | MASK_THURSDAY | MASK_FRIDAY | MASK_SATURDAY | MASK_SUNDAY |
Mask value for every day of the week 0x7f = 127. | |
static const uint8_t | MASK_WEEKDAY = MASK_MONDAY | MASK_TUESDAY | MASK_WEDNESDAY | MASK_THURSDAY | MASK_FRIDAY |
Mask value for weekdays Monday - Friday 0x3e = 62. | |
static const uint8_t | MASK_WEEKEND = MASK_SATURDAY | MASK_SUNDAY |
Mask value for Saturday and Sunday 0x41 = 65. | |
Class for managing a mask value of zero or more days of the week.
Day 0 = Sunday, 1 = Monday, ..., 6 = Saturday
This class is copyable and assignable and can be tested for equality and inequality
|
inline |
Sets days of weeks with a bit mask of days.
mask | Pass values like MASK_SUNDAY, MASK_WEEKDAYS, MASK_WEEKENDS, MASK_ALL, or a custom value |
|
inline |
Get the current mask value.
|
inline |
Returns true if no days of the week are set in this object.
|
inline |
Returns true if the specified dayOfWeek is set in the mask.
dayOfWeek | Same as struct tm. 0 < dayOfWeek <= 6. Sunday = 0. |
|
inline |
return true if ymd is a day set in this object
ymd |
|
inline |
Tests if this object does not have the same mask as other.
other |
|
inline |
Tests if this object has the same mask as other.
other |
|
inline |
Set the mask value.
mask |
|
inline |
Converts this object to a human-readable string.
|
inline |
Convenience fluent setter to set all days.
|
inline |
Convenience fluent setter to set all weekdays (Monday - Friday)
|
inline |
Convenience fluent setter to set weekend days (Saturday and Sunday)