libdballe
9.11
|
#include <types.h>
Public Member Functions | |
Time () | |
Construct a missing time. | |
Time (int ho, int mi=0, int se=0) | |
Construct from broken down values. More... | |
Time (const Time &t)=default | |
bool | is_missing () const |
Check if this time is the missing value. | |
void | to_stream_iso8601 (std::ostream &out) const |
Write the time to an output stream in ISO8601 extended format (hh:mm:ss). | |
void | to_csv_iso8601 (CSVWriter &out) const |
Write the time as a CSV field in ISO8601 date format. | |
int | compare (const Time &other) const |
Generic comparison. More... | |
bool | operator< (const Time &dt) const |
bool | operator> (const Time &dt) const |
bool | operator== (const Time &dt) const |
bool | operator!= (const Time &dt) const |
Static Public Member Functions | |
static void | validate (int ho, int mi, int se) |
Raise an exception if the three values do not represent a valid time. More... | |
Public Attributes | |
unsigned char | hour |
unsigned char | minute |
unsigned char | second |
Time of the day.
If hour is 0xff, then all the time is considered missing. Else, all fields must be set.
dballe::Time::Time | ( | int | ho, |
int | mi = 0 , |
||
int | se = 0 |
||
) |
Construct from broken down values.
A hour of MISSING_INT constructs a missing Time. In any other case, arguments are validated with Time::validate().
int dballe::Time::compare | ( | const Time & | other | ) | const |
Generic comparison.
Returns a negative number if *this < other Returns zero if *this == other Returns a positive number if *this > other
|
static |
Raise an exception if the three values do not represent a valid time.
A value of 23:59:60 is allowed to accomodate for times during leap seconds.