#include <period.h>
Public Member Functions | |
Duration (size_t years, size_t months, size_t seconds) | |
Rather inconvenient, the static functions below are probably more useful. | |
Duration | operator+ (const Duration &d) const |
Add two duration: separately adds the differen second/month/year units. | |
Duration | operator+= (const Duration &d) |
Add a duration to a duration: separately adds the differen second/month/year units. | |
size_t | years () const |
Number of years of duration. | |
size_t | months () const |
Number of months of duration. | |
size_t | seconds () const |
Number of seconds of duration. | |
std::string | str () const |
Return string representation of duration. | |
Static Public Member Functions | |
Duration | mins (size_t mins, size_t secs=0) |
Duration | hrs (size_t hrs, size_t mins=0, size_t secs=0) |
Duration | days (size_t days, size_t hrs=0, size_t mins=0, size_t secs=0) |
Duration | weeks (size_t wks, size_t days=0, size_t hrs=0, size_t mins=0, size_t secs=0) |
Duration | months (size_t months) |
Duration | years (size_t years, size_t months=0) |
Private Attributes | |
size_t | years_ |
size_t | months_ |
unsigned long | seconds_ |
This is intended for administrative applications, e.g. adding a duration of 24 hrs to a Date will result in the next day, same time, even if a daylight savings time switch happens in the period.
There are 3 incompatible units:
Definition at line 25 of file period.h.
|
Rather inconvenient, the static functions below are probably more useful. |
|
Convenience replacements for constructor. |
|
Convenience replacements for constructor. |
|
Convenience replacements for constructor. |
|
Convenience replacements for constructor. |
|
Convenience replacements for constructor. |
|
Convenience replacements for constructor. |
|
Add two duration: separately adds the differen second/month/year units.
|
|
Add a duration to a duration: separately adds the differen second/month/year units.
|
|
Number of years of duration. Definition at line 49 of file period.h. References years_. |
|
Number of months of duration. Definition at line 51 of file period.h. References months_. |
|
Number of seconds of duration. Definition at line 53 of file period.h. References seconds_. |
|
Return string representation of duration. This has the form YY-MM-DD HH:MM:SS |
|
Definition at line 63 of file period.h. Referenced by Duration(), and years(). |
|
Definition at line 64 of file period.h. Referenced by Duration(), and months(). |
|
Definition at line 65 of file period.h. Referenced by Duration(), and seconds(). |
dvutil-0.13.15 | [30 December, 2004] |