#include <Duration.h>

Public Member Functions | |
| Duration (double seconds) | |
| Constructor. | |
| Duration (const String &str) | |
| Constructor. | |
| Duration (uint_t days, uint_t hours, uint_t minutes, double seconds) | |
| Constructor. | |
| virtual String | toString () const |
| Get a string representation. | |
| uint_t | getDays () const |
| Get the number of days. | |
| uint_t | getHours () const |
| Get the number of hours. | |
| uint_t | getMinutes () const |
| Get the number of minutes. | |
| double | getSeconds () const |
| Get the number of seconds. | |
| virtual Number< double > & | set (const String &str) |
| Set with a format string. | |
| void | set (uint_t days, uint_t hours, uint_t minutes, double seconds) |
| Set a new duration. | |
| void | setUnit (uint_t unit, uint_t num=1) |
| Set to a multiple of a given unit. | |
| Duration | operator+ (const Duration &rhs) const |
| Add the given duration to self and return the result. | |
| Duration | operator- (const Duration &rhs) const |
| Subtract the given duration from self and return the result. | |
Static Public Attributes | |
| static const Duration | oneDay |
| Duration of one day. | |
| static const Duration | oneHour |
| Duration of one hour. | |
| static const Duration | oneHalfHour |
| Duration of half an hour. | |
| static const Duration | oneMinute |
| Duration of one minute. | |
| static const Duration | oneSecond |
| Duration of one second. | |
String Representation Formatting
The format string takes the form:
[<numDays> d] [<numHours> h] [<numMinutes> m] [<numSeconds> s]
The following are examples of valid format strings:
Definition at line 40 of file Duration.h.
| utl::Duration::Duration | ( | double | seconds | ) | [inline] |
| utl::Duration::Duration | ( | const String & | str | ) | [inline] |
Constructor.
| days | number of days | |
| hours | number of hours | |
| minutes | number of minutes | |
| seconds | number of seconds |
Definition at line 66 of file Duration.h.
| virtual String utl::Duration::toString | ( | ) | const [virtual] |
| uint_t utl::Duration::getDays | ( | ) | const [inline] |
| uint_t utl::Duration::getHours | ( | ) | const [inline] |
| uint_t utl::Duration::getMinutes | ( | ) | const [inline] |
| double utl::Duration::getSeconds | ( | ) | const [inline] |
Set a new duration.
| days | number of days | |
| hours | number of hours | |
| minutes | number of minutes | |
| seconds | number of seconds |
Add the given duration to self and return the result.
| rhs | duration to add |
Definition at line 119 of file Duration.h.
Subtract the given duration from self and return the result.
| rhs | duration to subtract |
Definition at line 127 of file Duration.h.
const Duration utl::Duration::oneDay [static] |
const Duration utl::Duration::oneHour [static] |
const Duration utl::Duration::oneHalfHour [static] |
const Duration utl::Duration::oneMinute [static] |
const Duration utl::Duration::oneSecond [static] |
1.5.6