OSSIM - Open Source Software Image Map
Version 1.9.0 (20180803)
|
#include <ossimDuration.h>
Public Member Functions | |
ossimDuration (const ossimString &iso8601Duration=ossimString("")) | |
This will take an iso8601 encoded duration string and parse out the individual values. More... | |
void | clearFields () |
zero out all fields More... | |
bool | readIso8601Encoding (std::istream &in) |
This will take an iso8601 encoded duration stream and parse out the individual values it will stop when a blank character or whitespace is found. More... | |
bool | setByIso8601DurationString (const ossimString &iso8601Duration) |
This will take an iso8601 encoded duration stream and parse out the individual values it will stop when a blank character or whitespace is found. More... | |
void | toIso8601DurationString (ossimString &result) |
Will take the field values and encode into a iso8601 string format. More... | |
ossim_float64 | toSeconds () const |
this will not use the months field or the years field but will use all other fields to calculate a total value in seconds. More... | |
void | setSign (ossim_int32 value) |
ossim_int32 | sign () const |
returns the sign. More... | |
void | setYears (ossim_uint64 value) |
ossim_int64 | years () const |
void | setMonths (ossim_uint64 value) |
ossim_int64 | months () const |
void | setWeeks (ossim_uint64 value) |
ossim_int64 | weeks () const |
void | setDays (ossim_uint64 value) |
ossim_int64 | days () const |
void | setHours (ossim_uint64 value) |
ossim_int64 | hours () const |
void | setMinutes (ossim_uint64 value) |
ossim_int64 | minutes () const |
void | setSeconds (ossim_float64 value) |
ossim_float64 | seconds () const |
void | setAll (ossim_int32 signValue, ossim_uint64 yearsValue, ossim_uint64 monthsValue, ossim_uint64 weeksValue, ossim_uint64 daysValue, ossim_uint64 hoursValue, ossim_uint64 minutesValue, ossim_float64 secondsValue) |
Sets all values in one call. More... | |
Protected Attributes | |
ossim_int32 | theSign |
ossim_int64 | theYears |
ossim_int64 | theMonths |
ossim_int64 | theWeeks |
ossim_int64 | theDays |
ossim_int64 | theHours |
ossim_int64 | theMinutes |
ossim_float64 | theSeconds |
Definition at line 18 of file ossimDuration.h.
ossimDuration::ossimDuration | ( | const ossimString & | iso8601Duration = ossimString("") | ) |
This will take an iso8601 encoded duration string and parse out the individual values.
Definition at line 15 of file ossimDuration.cpp.
References ossimString::empty(), and setByIso8601DurationString().
void ossimDuration::clearFields | ( | ) |
zero out all fields
Definition at line 31 of file ossimDuration.cpp.
References theDays, theHours, theMinutes, theMonths, theSeconds, theSign, theWeeks, and theYears.
Referenced by readIso8601Encoding(), and setByIso8601DurationString().
|
inline |
Definition at line 103 of file ossimDuration.h.
|
inline |
Definition at line 111 of file ossimDuration.h.
|
inline |
Definition at line 119 of file ossimDuration.h.
|
inline |
Definition at line 87 of file ossimDuration.h.
bool ossimDuration::readIso8601Encoding | ( | std::istream & | in | ) |
This will take an iso8601 encoded duration stream and parse out the individual values it will stop when a blank character or whitespace is found.
Definition at line 51 of file ossimDuration.cpp.
References clearFields(), and theSign.
Referenced by setByIso8601DurationString().
|
inline |
Definition at line 127 of file ossimDuration.h.
|
inline |
bool ossimDuration::setByIso8601DurationString | ( | const ossimString & | iso8601Duration | ) |
This will take an iso8601 encoded duration stream and parse out the individual values it will stop when a blank character or whitespace is found.
Definition at line 167 of file ossimDuration.cpp.
References clearFields(), ossimString::empty(), and readIso8601Encoding().
Referenced by ossimDuration().
|
inline |
Definition at line 99 of file ossimDuration.h.
|
inline |
Definition at line 107 of file ossimDuration.h.
|
inline |
Definition at line 115 of file ossimDuration.h.
|
inline |
Definition at line 83 of file ossimDuration.h.
|
inline |
Definition at line 123 of file ossimDuration.h.
|
inline |
Definition at line 64 of file ossimDuration.h.
|
inline |
Definition at line 91 of file ossimDuration.h.
|
inline |
Definition at line 75 of file ossimDuration.h.
|
inline |
returns the sign.
Should be either -1 or 1 for the return
Definition at line 71 of file ossimDuration.h.
void ossimDuration::toIso8601DurationString | ( | ossimString & | result | ) |
Will take the field values and encode into a iso8601 string format.
Note, anything that is 0 will not be output.
Definition at line 178 of file ossimDuration.cpp.
References ossim::almostEqual(), theDays, theHours, theMinutes, theMonths, theSeconds, theSign, theWeeks, theYears, and ossimString::toString().
ossim_float64 ossimDuration::toSeconds | ( | ) | const |
this will not use the months field or the years field but will use all other fields to calculate a total value in seconds.
We can not determine leap years and how many days are in a month so those are omitted and so this serves as a utility method to just calculate the total seconds if you give a duration string that contains only one or all or any of the following: weeks, days, minutes, hours, and/or seconds.
If the sign is set to negative it will return a negative value.
Definition at line 242 of file ossimDuration.cpp.
References theDays, theHours, theMinutes, theSeconds, theSign, and theWeeks.
|
inline |
Definition at line 95 of file ossimDuration.h.
|
inline |
Definition at line 79 of file ossimDuration.h.
|
protected |
Definition at line 160 of file ossimDuration.h.
Referenced by clearFields(), toIso8601DurationString(), and toSeconds().
|
protected |
Definition at line 161 of file ossimDuration.h.
Referenced by clearFields(), toIso8601DurationString(), and toSeconds().
|
protected |
Definition at line 162 of file ossimDuration.h.
Referenced by clearFields(), toIso8601DurationString(), and toSeconds().
|
protected |
Definition at line 158 of file ossimDuration.h.
Referenced by clearFields(), and toIso8601DurationString().
|
protected |
Definition at line 163 of file ossimDuration.h.
Referenced by clearFields(), toIso8601DurationString(), and toSeconds().
|
protected |
Definition at line 156 of file ossimDuration.h.
Referenced by clearFields(), readIso8601Encoding(), toIso8601DurationString(), and toSeconds().
|
protected |
Definition at line 159 of file ossimDuration.h.
Referenced by clearFields(), toIso8601DurationString(), and toSeconds().
|
protected |
Definition at line 157 of file ossimDuration.h.
Referenced by clearFields(), and toIso8601DurationString().