Inheritance diagram for lfc::TimeSpan::
Public Methods | |
TimeSpan () throw () | |
TimeSpan (const TimeSpan &ts) throw () | |
TimeSpan (long seconds) | |
creates an object with the period specified in seconds. More... | |
TimeSpan (long seconds, long minutes, long hours=0, long days=0) | |
virtual | ~TimeSpan () throw () |
virtual long | seconds () const throw () |
| |
virtual long | minutes () const throw () |
| |
virtual long | hours () const throw () |
| |
virtual long | days () const throw () |
| |
virtual bool | operator== (const TimeSpan &ts) const throw () |
virtual bool | operator< (const TimeSpan &ts) const throw () |
virtual const TimeSpan & | operator= (const TimeSpan &ts) throw () |
virtual const TimeSpan | operator+ (const TimeSpan &ts) const |
virtual const TimeSpan | operator- (const TimeSpan &ts) const |
virtual void | writeObject (BinaryOutput &stream) const |
platform independent serialization. More... | |
virtual void | readObject (BinaryInput &stream) |
platform independent deserialization. More... | |
virtual void | formatObject (TextOutput &stream, string format="") const |
formatting based on a certain format. More... | |
virtual void | scanObject (TextInput &stream, string format="") |
scanning based on a certain format. More... | |
Protected Attributes | |
long | m_span |
See Time example for a code sample.
|
|
|
|
|
creates an object with the period specified in seconds.
|
|
creates an object specifing how many days, hours, minutes and seconds the time span takes, so:
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
platform independent serialization.
Reimplemented from lfc::_Serializable. |
|
platform independent deserialization.
Reimplemented from lfc::_Serializable. |
|
formatting based on a certain format. The format must be as follows:
Symbol Meaning Presentation Example ------ ------- ------------ ------- D in days Number 2.5 d floor(days) Number 2 H in hours Number 15.25 h floor(hours) Number 15 M in minutes Number 37.9 m floor(minutes) Number 37 s in seconds Number 125 -d days(0..24855) Number 2 -h hours(0..23) Number 12 -m minutes(0..59) Number 50 -s seconds(0..59) Number 43 ' escape for text Text 'seconds' '' single quote Text ' Any characters in the pattern that are not in this formatting list will be treated as quoted text. For instance, characters like ':', ',', '.', ' ', '#' and '@' will appear in the resulting time text even they are not embraced within single quotes. Examples:
Format Pattern Result -------------- ------ "M 'minutes; ' s 'seconds'" ->> "12.5 minutes; 750 seconds" "-h 'hours', -m 'mins' and -s 'secs'" ->> "2 hours, 12 mins and 58 secs" Reimplemented from lfc::_Formatable. |
|
scanning based on a certain format.
The format used for scanning is identical to that used for formatting and if the format or the data coming from the stream are invalid, an TimeSpanException will be thrown.
Reimplemented from lfc::_Scanable. |
|
|