This class represents a time span, measured in human units like days, hours, minutes, and so on. Besides conversion from and to nanoseconds, conversions from and to objects of types DateTime::Duration and Ticks::Duration is supported.
Definition at line 180 of file calendar.hpp.
#include <calendar.hpp>
Public Field Index: | |
| int | Days |
| The number of days within the duration. | |
| int | Hours |
| The number of hours (not the total, hence 0-23) within the duration. | |
| int | Microseconds |
| The number of microseconds (not the total, hence 0-999) within the duration. | |
| int | Milliseconds |
| The number of milliseconds (not the total, hence 0-999) within the duration. | |
| int | Minutes |
| The number of minutes (not the total, hence 0-59) within the duration. | |
| int | Nanoseconds |
| The number of nanoseconds (not the total, hence 0-999) within the duration. | |
| int | Seconds |
| The number of seconds (not the total, hence 0-59) within the duration. | |
Public Method Index: | |
| CalendarDuration (DateTime::Duration duration) | |
| CalendarDuration (int64_t nanos) | |
| CalendarDuration (lang::Initialization init=lang::Initialization::Default) | |
| CalendarDuration (Ticks::Duration duration) | |
| void | Clear () |
| Sets all public values to 0. | |
| void | FromDuration (DateTime::Duration duration) |
| void | FromDuration (Ticks::Duration duration) |
| void | FromNanoSeconds (int64_t nanos) |
| DateTime::Duration | ToDateTimeDuration () |
| int64_t | ToNanoSeconds () |
| Ticks::Duration | ToTicksDuration () |
| int alib::strings::util::CalendarDuration::Days |
The number of days within the duration.
Definition at line 183 of file calendar.hpp.
| int alib::strings::util::CalendarDuration::Hours |
The number of hours (not the total, hence 0-23) within the duration.
Definition at line 186 of file calendar.hpp.
| int alib::strings::util::CalendarDuration::Microseconds |
The number of microseconds (not the total, hence 0-999) within the duration.
Definition at line 198 of file calendar.hpp.
| int alib::strings::util::CalendarDuration::Milliseconds |
The number of milliseconds (not the total, hence 0-999) within the duration.
Definition at line 195 of file calendar.hpp.
| int alib::strings::util::CalendarDuration::Minutes |
The number of minutes (not the total, hence 0-59) within the duration.
Definition at line 189 of file calendar.hpp.
| int alib::strings::util::CalendarDuration::Nanoseconds |
The number of nanoseconds (not the total, hence 0-999) within the duration.
Definition at line 201 of file calendar.hpp.
| int alib::strings::util::CalendarDuration::Seconds |
The number of seconds (not the total, hence 0-59) within the duration.
Definition at line 192 of file calendar.hpp.
|
inline |
Constructs the object to represent a duration of 0. (Sets all public fields to 0.)
| init | If Default or Nulled, Clear is invoked. Otherwise fields are not initialized. Defaults to Default. |
Definition at line 207 of file calendar.hpp.
|
inline |
Constructs the object using the given duration measured in nanoseconds. Invokes FromNanoSeconds.
| nanos | The duration to use for setting the public fields. |
Definition at line 216 of file calendar.hpp.
|
inline |
Constructs the object using the given duration object. Invokes FromDuration(DateTime::Duration).
| duration | The duration to use for setting the public fields. |
Definition at line 221 of file calendar.hpp.
|
inline |
Constructs the object using the given duration object. Invokes FromDuration(Ticks::Duration).
| duration | The duration to use for setting the public fields. |
Definition at line 226 of file calendar.hpp.
| void alib::strings::util::CalendarDuration::Clear | ( | ) |
Sets all public values to 0.
Definition at line 137 of file calendar.cpp.
|
inline |
Sets the public fields to represent the given duration value. The state of the object will hereafter be the same as it was when constructed with the same parameter.
| duration | The duration to use for setting the public fields. |
Definition at line 232 of file calendar.hpp.
|
inline |
Sets the public fields to represent the given duration value. The state of the object will hereafter be the same as it was when constructed with the same parameter.
| duration | The duration to use for setting the public fields. |
Definition at line 239 of file calendar.hpp.
| void alib::strings::util::CalendarDuration::FromNanoSeconds | ( | int64_t | nanos | ) |
Sets the public fields to represent the given duration value. The state of the object will hereafter be the same as it was when constructed with the same parameter.
| nanos | The duration to use for setting the public fields. |
Definition at line 154 of file calendar.cpp.
|
inline |
Takes the current values of the public fields and returns a duration value compatible with class DateTime.
Definition at line 245 of file calendar.hpp.
| int64_t alib::strings::util::CalendarDuration::ToNanoSeconds | ( | ) |
Takes the current values of the public fields and returns the duration.
Definition at line 165 of file calendar.cpp.
|
inline |
Takes the current values of the public fields and returns a duration value compatible with class Ticks.
Definition at line 251 of file calendar.hpp.