Represents a date, time and time zone offset stored as a named tuple of each component. More...
#include <rw/tools/timetupleoffset.h>
Public Member Functions | |
RWTimeTupleOffset () | |
RWTimeTupleOffset (int year, int mon, int mday, int hour, int min, int sec, rwint64 pico, int gmtoff) | |
RWTimeTupleOffset (const RWDate &date, int hour=0, int min=0, int sec=0, rwint64 pico=0, int gmtoff=0) | |
RWTimeTupleOffset (const RWDateTime &dt, const RWZone &zone=RWZone::local()) | |
RWTimeTupleOffset (const RWTimeTuple &tt, int gmtoff=0) | |
RWTimeTupleOffset (const struct tm *t, rwint64 pico=0, int gmtoff=0) | |
RWTimeTupleOffset (const RWTimeTupleOffset &other) | |
int | dayOfMonth () const |
void | dayOfMonth (int d) |
void | extract (struct tm *tt) const |
int | gmtoff () const |
void | gmtoff (int s) |
int | hour () const |
void | hour (int h) |
int | minute () const |
void | minute (int m) |
int | month () const |
void | month (int m) |
RWTimeTupleOffset & | operator= (const RWTimeTupleOffset &) |
rwint64 | picosecond () const |
void | picosecond (rwint64 p) |
int | second () const |
void | second (int s) |
int | year () const |
void | year (int y) |
Related Functions | |
(Note that these are not member functions.) | |
RWvostream & | operator<< (RWvostream &str, const RWTimeTupleOffset &t) |
RWFile & | operator<< (RWFile &file, const RWTimeTupleOffset &t) |
RWvistream & | operator>> (RWvistream &str, RWTimeTupleOffset &t) |
RWFile & | operator>> (RWFile &file, RWTimeTupleOffset &t) |
RWvistream & | operator>> (RWvistream &str, RWTimeTupleOffset *&t) |
RWFile & | operator>> (RWFile &file, RWTimeTupleOffset *&t) |
RWTimeTupleOffset represents a date, time and time zone offset, stored as a tuple of each calendar component (e.g. year, month, day, hour, minute, second, picosecond, gmtoff).
RWTimeTupleOffset may be useful when individual calendar components will be accessed/modified, but where comparisons and calculations on the overall date/time aren't required. In cases where comparisons and calculations are required, see RWDateTime.
RWTimeTupleOffset represents a specific instance in time. In cases when time zone information is not required, RWTimeTuple should be used.
|
inline |
Default constructor. All fields of the RWTimeTupleOffset instance are set to -1.
|
inline |
Constructs each field of the RWTimeTupleOffset.
|
explicit |
Constructs an RWTimeTupleOffset based on the year, month and day of the month from date and other fields as specified in the parameters. If date is invalid, all fields in RWTimeTupleOffset are set to -1.
|
explicit |
Constructs an RWTimeTupleOffset based on the date/time information in dt, as interpreted in the time zone zone. If dt is a sentinel value, all fields in RWTimeTupleOffset are set to -1. Otherwise, this function retrieves the date and time components from dt using dt.extract()'.
|
explicit |
Constructs an RWTimeTupleOffset based on the contents of tt and the GMT offset gmtoff.
|
inlineexplicit |
Constructs an RWTimeTupleOffset based on the date/time information in t and the GMT offset gmtoff.
t->tm_year > INT_MAX - 1900
or if t->tm_mon > INT_MAX - 1
, the results are undefined.
|
inline |
Copy constructor.
|
inline |
Returns the day of the month.
|
inline |
Sets the day of the month to d.
|
inline |
Populates the struct tm
tt based on the values in self. The fields tm_wday
, tm_yday
and tm_isdst
are set to -1 as that information is not known in RWTimeTupleOffset. The picoseconds value of the RWTimeTupleOffset is ignored.
getYear() < INT_MIN + 1900
or if getMonth() < INT_MIN + 1
, the results are undefined.
|
inline |
Returns the offset from GMT, in seconds.
|
inline |
Sets the offset from GMT, in seconds.
|
inline |
Returns the number of hours.
|
inline |
Sets the number of hours to h.
|
inline |
Returns the number of minutes.
|
inline |
Sets the number of minutes to m.
|
inline |
Returns the month index (0 == January).
|
inline |
Sets the month index to m (0 == January).
|
inline |
Assignment operator.
|
inline |
Returns the number of picoseconds.
|
inline |
Sets the number of picoseconds to p.
|
inline |
Returns the number of seconds.
|
inline |
Sets the number of seconds to s.
|
inline |
Returns the year.
|
inline |
Sets the year to y.
|
related |
Saves t to a virtual stream.
|
related |
Saves t to an RWFile.
|
related |
Restores t from a virtual stream, replacing the previous contents of t.
|
related |
Restores t from an RWFile, replacing the previous contents of t.
|
related |
Restores an RWTimeTupleOffset from a virtual stream by allocating an RWTimeTupleOffset on the heap and restoring its state.
|
related |
Restores an RWTimeTupleOffset from an RWFile by allocating an RWTimeTupleOffset on the heap and restoring its state.
Copyright © 2021 Rogue Wave Software, Inc., a Perforce company. All Rights Reserved. |