LocalTimeRK
Public Member Functions
LocalTimeHMSRestricted Class Reference

HMS values, but only on specific days of week or dates (with optional exceptions) More...

#include <LocalTimeRK.h>

Inheritance diagram for LocalTimeHMSRestricted:
LocalTimeHMS LocalTimeRestrictedDate

Public Member Functions

 LocalTimeHMSRestricted ()
 Default constructor restricts to no valid dates!
 
 LocalTimeHMSRestricted (LocalTimeHMS hms)
 Default Sets a hour minute second value on any date. More...
 
 LocalTimeHMSRestricted (LocalTimeHMS hms, LocalTimeRestrictedDate restrictedDate)
 Default Sets a hour minute second value with date restrictions. More...
 
void fromJson (JSONValue jsonObj)
 Fills in this object from JSON data. More...
 
- Public Member Functions inherited from LocalTimeHMS
 LocalTimeHMS ()
 Default constructor. Sets time to 00:00:00.
 
virtual ~LocalTimeHMS ()
 Destructor.
 
 LocalTimeHMS (const char *str)
 Constructs the object from a time string. More...
 
 LocalTimeHMS (const LocalTimeValue &value)
 Construct this HMS from a LocalTimeValue (which contains YMD and HMS) More...
 
void clear ()
 Sets the hour, minute, and second to 0.
 
void parse (const char *str)
 Parse a "H:MM:SS" string. More...
 
String toString () const
 Turns the parsed data into a normalized string of the form: "HH:MM:SS" (24-hour clock, with leading zeroes)
 
int toSeconds () const
 Convert hour minute second into a number of seconds (simple multiplication and addition)
 
void fromTimeInfo (const struct tm *pTimeInfo)
 Sets the hour, minute, and second fields from a struct tm.
 
void fromLocalTimeValue (const LocalTimeValue &value)
 Sets the HMS from a LocalTimeValue. More...
 
void toTimeInfo (struct tm *pTimeInfo) const
 Fill in the tm_hour, tm_min, and tm_sec fields of a struct tm from the values in this object. More...
 
void adjustTimeInfo (struct tm *pTimeInfo) const
 Adjust the values in a struct tm from the values in this object. More...
 
void fromJson (JSONValue jsonObj)
 Parses a JSON value of type string in HH:MM:SS format. More...
 
LocalTimeHMSwithHour (int hour)
 Sets this object to be the specified hour, with minute and second set to 0. More...
 
LocalTimeHMSwithHourMinute (int hour, int minute)
 Sets this object to be the specified hour and minute, with second set to 0. More...
 
int compareTo (const LocalTimeHMS &other) const
 Compare two LocalTimeHMS objects. More...
 
bool operator== (const LocalTimeHMS &other) const
 Returns true if this item is equal to other. Compares hour, minute, and second. More...
 
bool operator!= (const LocalTimeHMS &other) const
 Returns true if this item is not equal to other. More...
 
bool operator< (const LocalTimeHMS &other) const
 Returns true if this item is < other. More...
 
bool operator> (const LocalTimeHMS &other) const
 Returns true if this item is > other. More...
 
bool operator<= (const LocalTimeHMS &other) const
 Returns true if this item <= other. More...
 
bool operator>= (const LocalTimeHMS &other) const
 Returns true if this item is >= other. More...
 
- Public Member Functions inherited from LocalTimeRestrictedDate
 LocalTimeRestrictedDate ()
 Create an empty restricted date object. It will return false for any date passed to isValid.
 
 LocalTimeRestrictedDate (uint8_t mask)
 Create a date restricted object restricted to days of the week. More...
 
 LocalTimeRestrictedDate (uint8_t mask, std::initializer_list< const char * > onlyOnDates, std::initializer_list< const char * > exceptDates)
 Construct an object with an initializer list of strings. More...
 
 LocalTimeRestrictedDate (uint8_t mask, std::initializer_list< LocalTimeYMD > onlyOnDates, std::initializer_list< LocalTimeYMD > exceptDates)
 Construct an object with an initializer list of LocalTimeYMD objects. More...
 
LocalTimeRestrictedDatewithOnAllDays ()
 Set the mask value to MASK_ALL. Does not change only on date or except on date lists. More...
 
LocalTimeRestrictedDatewithOnlyOnDays (LocalTimeDayOfWeek value)
 Restrict to days of the week. More...
 
LocalTimeRestrictedDatewithOnlyOnDays (uint8_t mask)
 Restrict to certain dates. More...
 
LocalTimeRestrictedDatewithOnlyOnDates (std::initializer_list< const char * > dates)
 Restrict to certain dates. More...
 
LocalTimeRestrictedDatewithOnlyOnDates (std::initializer_list< LocalTimeYMD > dates)
 Restrict to certain dates. More...
 
LocalTimeRestrictedDatewithExceptDates (std::initializer_list< const char * > dates)
 Dates that will always return false for isValid. More...
 
LocalTimeRestrictedDatewithExceptDates (std::initializer_list< LocalTimeYMD > dates)
 Dates that will always return false for isValid. More...
 
bool isEmpty () const
 Returns true if onlyOnDays mask is 0 and the onlyOnDates and exceptDates lists are empty. More...
 
void clear ()
 Clear all settings.
 
bool isValid (LocalTimeValue localTimeValue) const
 Returns true if a date is in the onlyOnDays or onlyOnDates list, and not in the exceptDates list. More...
 
bool isValid (LocalTimeYMD ymd) const
 Returns true if a date is in the onlyOnDays or onlyOnDates list, and not in the exceptDates list. More...
 
bool inOnlyOnDates (LocalTimeYMD ymd) const
 Returns true of a date is in the onlyOnDates list. More...
 
bool inExceptDates (LocalTimeYMD ymd) const
 Returns true of a date is in the exceptDates list. More...
 
LocalTimeYMD getExpirationDate () const
 Get the last date (YMD) that this restricted date could be valid. More...
 
void fromJson (JSONValue jsonObj)
 Fills in this object from JSON data. More...
 

Additional Inherited Members

- Data Fields inherited from LocalTimeHMS
int8_t hour = 0
 0-23 hour (could also be negative)
 
int8_t minute = 0
 0-59 minute
 
int8_t second = 0
 0-59 second
 
int8_t ignore = 0
 Special case.
 
- Data Fields inherited from LocalTimeRestrictedDate
LocalTimeDayOfWeek onlyOnDays
 Allow on that day of week if mask bit is set.
 
std::vector< LocalTimeYMDonlyOnDates
 Dates to allow.
 
std::vector< LocalTimeYMDexceptDates
 Dates to exclude.
 

Detailed Description

HMS values, but only on specific days of week or dates (with optional exceptions)

Constructor & Destructor Documentation

◆ LocalTimeHMSRestricted() [1/2]

LocalTimeHMSRestricted::LocalTimeHMSRestricted ( LocalTimeHMS  hms)
inline

Default Sets a hour minute second value on any date.

Parameters
hmsThe hour minute second to set

◆ LocalTimeHMSRestricted() [2/2]

LocalTimeHMSRestricted::LocalTimeHMSRestricted ( LocalTimeHMS  hms,
LocalTimeRestrictedDate  restrictedDate 
)
inline

Default Sets a hour minute second value with date restrictions.

Parameters
hmsThe hour minute second to set
restrictedDateDate restrictions

Member Function Documentation

◆ fromJson()

void LocalTimeHMSRestricted::fromJson ( JSONValue  jsonObj)

Fills in this object from JSON data.

Parameters
jsonObj

Keys:


The documentation for this class was generated from the following files: