![]() |
TSDuck v3.46-4930
MPEG Transport Stream Toolkit
|
#include <tsISOTime.h>
Public Types | |
| enum | TimeType { NONE = 0x00 , TIME = 0x01 , DURATION = 0x02 , START_END = 0x04 , START_DURATION = 0x08 , DURATION_END = 0x10 , RECURRING = 0x20 , ANY_INTERVAL = 0x1E , ANY = 0x3F } |
Public Member Functions | |
| ISOTime ()=default | |
| template<class Rep, class Period> | |
| ISOTime (cn::duration< Rep, Period > duration, const Time &end, size_t recurrences=0) | |
| template<class Rep, class Period> | |
| ISOTime (cn::duration< Rep, Period > duration, size_t recurrences=0) | |
| template<class Rep, class Period> | |
| ISOTime (const Time &start, cn::duration< Rep, Period > duration, size_t recurrences=0) | |
| ISOTime (const Time &start, const Time &end, size_t recurrences=0) | |
| ISOTime (const Time &time) | |
| ISOTime (const UString &str) | |
| void | clear () |
| cn::milliseconds | duration () const |
| Time | end () const |
| bool | fromString (const UString &str) |
| bool | isInterval () const |
| bool | isRecurring () const |
| bool | isSingleTime () const |
| bool | isUnbounded () const |
| bool | isValid () const |
| operator Time () const | |
| size_t | recurrences () const |
| Time | start () const |
| UString | toString (TimeType format=NONE) const |
| TimeType | type () const |
Static Public Member Functions | |
| static cn::milliseconds | DurationFromISO (const UString &str) |
| static Time | TimeFromISO (const UString &str) |
| template<class Rep, class Period> | |
| static UString | ToISO (cn::duration< Rep, Period > duration) |
| static UString | ToISO (const Time &time) |
| template<class Rep, class Period> | |
| static UString | ToISO (const Time &time, cn::duration< Rep, Period > utc_offset) |
Static Public Attributes | |
| static constexpr size_t | UNBOUNDED_RECURRENCES = std::numeric_limits<size_t>::max() |
The ISOTime class convert dates, times, and durations with ISO 8601 representation.
Type of time data which can be represented in ISO 8601.
|
default |
Default constructor.
|
inline |
Constructor from a string in ISO 8601 format.
| [in] | str | A string in ISO 8601 format. |
|
inline |
Constructor using one date & time value.
| [in] | time | The date & time to set. |
|
inline |
Constructor using a duration not associated with any start or end.
| [in] | duration | Time interval duration. |
| [in] | recurrences | If non-zero, the time-interval is recurring, with that number of recurrences. |
Constructor using a start and end date.
| [in] | start | Interval start time. |
| [in] | end | Interval end time. |
| [in] | recurrences | If non-zero, the time-interval is recurring, with that number of recurrences. |
|
inline |
Constructor using a start and a duration.
| [in] | start | Interval start time. |
| [in] | duration | Time interval duration. |
| [in] | recurrences | If non-zero, the time-interval is recurring, with that number of recurrences. |
|
inline |
Constructor using a duration and an end.
| [in] | duration | Time interval duration. |
| [in] | end | Interval end time. |
| [in] | recurrences | If non-zero, the time-interval is recurring, with that number of recurrences. |
| void ts::ISOTime::clear | ( | ) |
Reset the content of the object to an invalid state.
|
inline |
Check if this object contains a valid value.
|
inline |
Check if this object contains a single date & time value.
|
inline |
Check if this object contains a time interval (recurring or not).
|
inline |
Check if this object contains a recurring interval.
|
inline |
Check if this object contains an unbounded recurring interval.
|
inline |
Get the type of ISO 8601 time data.
Format this object as a ISO 8601 string.
| [in] | format | Required format. In NONE, use the default format for that object. |
| bool ts::ISOTime::fromString | ( | const UString & | str | ) |
Set the value of this object from a string in ISO 8601 format.
| [in] | str | A string in ISO 8601 format. |
|
inline |
Conversion to a Time value.
| Time ts::ISOTime::start | ( | ) | const |
Get the time interval start time.
| Time ts::ISOTime::end | ( | ) | const |
Get the time interval end time.
| cn::milliseconds ts::ISOTime::duration | ( | ) | const |
Get the duration of the time interval.
|
inline |
Get the number of recurrences of the time interval.
Decode a time from an ISO 8601 representation. Missing date fields default to the current UTC time. Missing time fields default to zero. The mpeg7:timePointType format is an extension of ISO 8601 and is also recognized here.
| [in] | str | A string describing a date and time in ISO 8601 representation. |
|
static |
Decode a duration from an ISO 8601 representation.
| [in] | str | A string describing a duration in ISO 8601 representation. |
Format a time in ISO 8601 representation.
| [in] | time | The date and time to format. |
|
inlinestatic |
Format a time in ISO 8601 representation, including an offset from UTC time.
| [in] | time | The date and time to format. |
| [in] | utc_offset | The offset from UTC time to include in the representation. |
|
inlinestatic |
Format a duration in ISO 8601 representation.
| [in] | duration | Time interval duration. |
|
staticconstexpr |
Number of time-interval recurrences meaning "unbounded".