23 #ifndef __ccxx_TimeSpan_hxx 24 #define __ccxx_TimeSpan_hxx 51 TimeSpan(
int days,
int hours,
int minutes,
int seconds,
int msec = 0);
60 void setSpan(
int days,
int hours,
int minutes,
int seconds,
int msec = 0);
63 void setSpan(int64_t seconds);
70 void setDays(
int days);
73 void addDays(
int days);
76 void subtractDays(
int days);
83 void setHours(
int hours);
86 void addHours(
int hours);
89 void subtractHours(
int hours);
96 void setMinutes(
int minutes);
99 void addMinutes(
int minutes);
102 void subtractMinutes(
int minutes);
106 {
return(_minutes); }
109 void setSeconds(
int seconds);
112 void addSeconds(
int seconds);
115 void subtractSeconds(
int seconds);
119 {
return(_seconds); }
122 void setMilliseconds(
int msec);
125 void addMilliseconds(
int msec);
128 void subtractMilliseconds(
int msec);
137 {
return(_span == other._span); }
140 {
return(_span < other._span); }
143 {
return(_span <= other._span); }
146 {
return(_span != other._span); }
149 {
return(_span > other._span); }
152 {
return(_span >= other._span); }
163 {
return(_span / msInSecond); }
166 inline operator int64_t()
const 190 void _computeFields(
int days,
int hours,
int minutes,
int seconds,
int msec);
191 void _computeFields(int64_t span);
203 #endif // __ccxx_TimeSpan_hxx const TimeSpan operator-(const TimeSpan &s1, const TimeSpan &s2)
Definition: TimeSpan.c++:386
A span of time (a delta), represented in milliseconds.
Definition: TimeSpan.h++:36
static const int msInSecond
The number of milliseconds in a second.
Definition: TimeSpan.h++:177
int getMilliseconds() const
Get the milliseconds component of the timespan.
Definition: TimeSpan.h++:131
bool operator<=(const TimeSpan &other) const
Definition: TimeSpan.h++:142
bool operator==(const TimeSpan &other) const
Definition: TimeSpan.h++:136
bool operator>(const TimeSpan &other) const
Definition: TimeSpan.h++:148
int64_t toMilliseconds() const
Get the timespan in milliseconds.
Definition: TimeSpan.h++:170
int getSeconds() const
Get the seconds component of the timespan.
Definition: TimeSpan.h++:118
bool operator!=(const TimeSpan &other) const
Definition: TimeSpan.h++:145
int getMinutes() const
Get the minutes component of the timespan.
Definition: TimeSpan.h++:105
int64_t getSpan() const
Get the timespan, in milliseconds.
Definition: TimeSpan.h++:66
#define COMMONCPP_API
Definition: Common.h++:126
#define INT64_CONST(I)
Declare a signed 64-bit integer constant I.
Definition: Integers.h++:122
A flexible, reference counted, copy-on-write, thread-safe, nullable string.
Definition: String.h++:50
static const int msInDay
The number of milliseconds in a day.
Definition: TimeSpan.h++:186
int64_t toSeconds() const
Get the timespan in seconds.
Definition: TimeSpan.h++:162
static const int msInHour
The number of milliseconds in an hour.
Definition: TimeSpan.h++:183
int getDays() const
Get the days component of the timespan.
Definition: TimeSpan.h++:79
static const int msInMinute
The number of milliseconds in a minute.
Definition: TimeSpan.h++:180
int getHours() const
Get the hours component of the timespan.
Definition: TimeSpan.h++:92
Definition: AllocationMap.c++:25
bool operator<(const TimeSpan &other) const
Definition: TimeSpan.h++:139
bool operator>=(const TimeSpan &other) const
Definition: TimeSpan.h++:151