#include <kptduration.h>
|
| enum | Format {
Format_DayTime
, Format_Day
, Format_Hour
, Format_HourFraction
,
Format_i18nDayTime
, Format_i18nDay
, Format_i18nHour
, Format_i18nHourFraction
} |
| enum | Unit {
Unit_d
, Unit_h
, Unit_m
, Unit_s
,
Unit_ms
} |
|
| static Duration | fromString (const TQString &s, Format format=Format_DayTime, bool *ok=0) |
The duration class can be used to store a timespan in a convenient format.
The timespan can be in length in many many hours down to miliseconds.
Definition at line 34 of file kptduration.h.
◆ Format
DayTime = d hh:mm:ss.sss Day = d.ddd Hour = hh:mm HourFraction = h.fraction of an hour.
Definition at line 42 of file kptduration.h.
◆ Unit
| enum KPlato::Duration::Unit |
◆ Duration() [1/4]
| KPlato::Duration::Duration |
( |
| ) |
|
◆ Duration() [2/4]
| KPlato::Duration::Duration |
( |
const Duration & | d | ) |
|
◆ Duration() [3/4]
| KPlato::Duration::Duration |
( |
unsigned | d, |
|
|
unsigned | h, |
|
|
unsigned | m, |
|
|
unsigned | s = 0, |
|
|
unsigned | ms = 0 ) |
◆ Duration() [4/4]
| KPlato::Duration::Duration |
( |
TQ_INT64 | seconds | ) |
|
◆ ~Duration()
| KPlato::Duration::~Duration |
( |
| ) |
|
◆ addDays()
| void KPlato::Duration::addDays |
( |
TQ_INT64 | delta | ) |
|
|
inline |
Adds.
- Parameters
-
| delta | to *this. If |
| delta | > *this, *this is set to zeroDuration. |
Definition at line 73 of file kptduration.h.
◆ addHours()
| void KPlato::Duration::addHours |
( |
TQ_INT64 | delta | ) |
|
|
inline |
Adds.
- Parameters
-
| delta | to *this. If |
| delta | > *this, *this is set to zeroDuration. |
Definition at line 68 of file kptduration.h.
◆ addMilliseconds()
| void KPlato::Duration::addMilliseconds |
( |
TQ_INT64 | delta | ) |
|
|
inline |
Adds.
- Parameters
-
| delta | to *this. If |
| delta | > *this, *this is set to zeroDuration. |
Definition at line 53 of file kptduration.h.
◆ addMinutes()
| void KPlato::Duration::addMinutes |
( |
TQ_INT64 | delta | ) |
|
|
inline |
Adds.
- Parameters
-
| delta | to *this. If |
| delta | > *this, *this is set to zeroDuration. |
Definition at line 63 of file kptduration.h.
◆ addSeconds()
| void KPlato::Duration::addSeconds |
( |
TQ_INT64 | delta | ) |
|
|
inline |
Adds.
- Parameters
-
| delta | to *this. If |
| delta | > *this, *this is set to zeroDuration. |
Definition at line 58 of file kptduration.h.
◆ days()
| unsigned KPlato::Duration::days |
( |
| ) |
const |
|
inline |
◆ fromString()
| Duration KPlato::Duration::fromString |
( |
const TQString & | s, |
|
|
Format | format = Format_DayTime, |
|
|
bool * | ok = 0 ) |
|
static |
◆ get()
| void KPlato::Duration::get |
( |
unsigned * | days, |
|
|
unsigned * | hours, |
|
|
unsigned * | minutes, |
|
|
unsigned * | seconds = 0, |
|
|
unsigned * | milliseconds = 0 ) const |
◆ hours()
| unsigned KPlato::Duration::hours |
( |
| ) |
const |
|
inline |
◆ milliseconds()
| TQ_INT64 KPlato::Duration::milliseconds |
( |
| ) |
const |
|
inline |
◆ minutes()
| TQ_INT64 KPlato::Duration::minutes |
( |
| ) |
const |
|
inline |
◆ operator!=() [1/2]
| bool KPlato::Duration::operator!= |
( |
const Duration & | d | ) |
const |
|
inline |
◆ operator!=() [2/2]
| bool KPlato::Duration::operator!= |
( |
TQ_INT64 | d | ) |
const |
|
inline |
◆ operator*() [1/2]
| Duration KPlato::Duration::operator* |
( |
const double | value | ) |
const |
◆ operator*() [2/2]
| Duration KPlato::Duration::operator* |
( |
int | unit | ) |
const |
◆ operator+()
| Duration KPlato::Duration::operator+ |
( |
const Duration & | d | ) |
const |
|
inline |
◆ operator+=()
| Duration & KPlato::Duration::operator+= |
( |
const Duration & | d | ) |
|
|
inline |
◆ operator-()
| Duration KPlato::Duration::operator- |
( |
const Duration & | d | ) |
const |
|
inline |
◆ operator-=()
| Duration & KPlato::Duration::operator-= |
( |
const Duration & | d | ) |
|
|
inline |
◆ operator/() [1/2]
| double KPlato::Duration::operator/ |
( |
const Duration & | d | ) |
const |
◆ operator/() [2/2]
| Duration KPlato::Duration::operator/ |
( |
int | unit | ) |
const |
◆ operator<() [1/2]
| bool KPlato::Duration::operator< |
( |
const Duration & | d | ) |
const |
|
inline |
◆ operator<() [2/2]
| bool KPlato::Duration::operator< |
( |
TQ_INT64 | d | ) |
const |
|
inline |
◆ operator<=() [1/2]
| bool KPlato::Duration::operator<= |
( |
const Duration & | d | ) |
const |
|
inline |
◆ operator<=() [2/2]
| bool KPlato::Duration::operator<= |
( |
TQ_INT64 | d | ) |
const |
|
inline |
◆ operator=()
| Duration & KPlato::Duration::operator= |
( |
const Duration & | d | ) |
|
|
inline |
◆ operator==() [1/2]
| bool KPlato::Duration::operator== |
( |
const Duration & | d | ) |
const |
|
inline |
◆ operator==() [2/2]
| bool KPlato::Duration::operator== |
( |
TQ_INT64 | d | ) |
const |
|
inline |
◆ operator>() [1/2]
| bool KPlato::Duration::operator> |
( |
const Duration & | d | ) |
const |
|
inline |
◆ operator>() [2/2]
| bool KPlato::Duration::operator> |
( |
TQ_INT64 | d | ) |
const |
|
inline |
◆ operator>=() [1/2]
| bool KPlato::Duration::operator>= |
( |
const Duration & | d | ) |
const |
|
inline |
◆ operator>=() [2/2]
| bool KPlato::Duration::operator>= |
( |
TQ_INT64 | d | ) |
const |
|
inline |
◆ seconds()
| TQ_INT64 KPlato::Duration::seconds |
( |
| ) |
const |
|
inline |
◆ toDouble()
| double KPlato::Duration::toDouble |
( |
Unit | u = Unit_ms | ) |
const |
|
inline |
◆ toString()
| TQString KPlato::Duration::toString |
( |
Format | format = Format_DayTime | ) |
const |
◆ zeroDuration
| const Duration KPlato::Duration::zeroDuration |
|
static |
This is useful for occasions where we need a zero duration.
Definition at line 126 of file kptduration.h.
The documentation for this class was generated from the following files:
|