#include <CeylanTimestamp.h>
Public Types | |
typedef Ceylan::Uint16 | Year |
Years are coded as pure numerical value, starting from 0 AC. | |
typedef Ceylan::Uint8 | MonthOfTheYear |
Months of the year range from 1 to 12, from January to December. | |
typedef Ceylan::Uint8 | DayOfTheMonth |
Days of the month range from 1 to 31. | |
typedef Ceylan::Uint8 | HourOfTheDay |
Hours of the day range from 0 to 23. | |
typedef Ceylan::Uint8 | MinuteOfTheHour |
Minutes of the hour range from 0 to 59. | |
typedef Ceylan::Uint8 | SecondOfTheMinute |
Seconds of the minute range from 0 to 61, to allow for leap seconds. | |
enum | TextOutputFormat { rawText, html } |
Defines what text output formats for TextDisplayable instances are available. More... | |
Public Member Functions | |
Timestamp () | |
Creates the timestamp corresponding to the moment when it is called. | |
virtual | ~Timestamp () throw () |
Basic virtual destructor. | |
virtual const std::string | toString (Ceylan::VerbosityLevels level=Ceylan::high) const |
Returns a user-friendly description of the state of this object. | |
bool | operator< (Timestamp &second) |
Tells whether this Timestamp's recorded time is strictly inferior to the one of second Timestamp. | |
Static Public Member Functions | |
static std::string | DescribeDuration (Ceylan::System::Second duration) |
Returns a string describing litterally the specied duration. | |
static const std::string | ToString (std::list< TextDisplayable * > displayables, Ceylan::VerbosityLevels level=Ceylan::high) |
Returns a user-friendly description of this list of pointers to text displayable instances. | |
static TextOutputFormat | GetOutputFormat () |
Returns the current overall text format to be used by TextDisplayable instances. | |
static void | SetOutputFormat (TextOutputFormat newOutputFormat) |
Sets the current overall text format to be used by TextDisplayable instances. | |
Protected Attributes | |
Year | _year |
Timestamp's year. | |
MonthOfTheYear | _month |
Timestamp's month. | |
DayOfTheMonth | _day |
Timestamp's day. | |
HourOfTheDay | _hour |
Timestamp's hour. | |
MinuteOfTheHour | _minute |
Timestamp's minute. | |
SecondOfTheMinute | _second |
Timestamp's second. | |
Static Protected Attributes | |
static TextOutputFormat | _OutputFormat = rawText |
The text format to be used currently by TextDisplayable instances. | |
Private Member Functions | |
Timestamp (const Timestamp &source) | |
Copy constructor made private to ensure that it will never be called. | |
Timestamp & | operator= (const Timestamp &source) |
Assignment operator made private to ensure that it will never be called. |
To understand numerical conventions behind the time units, one can have a look to UNIX 'ctime' manual, for example.
The granularity (accuracy) of this timestamp implementation is only one second, hence two timestamps may be exactly equal whereas they were not created at the same time.
Definition at line 65 of file CeylanTimestamp.h.
Months of the year range from 1 to 12, from January to December.
Definition at line 134 of file CeylanTimestamp.h.
Seconds of the minute range from 0 to 61, to allow for leap seconds.
Definition at line 154 of file CeylanTimestamp.h.
Years are coded as pure numerical value, starting from 0 AC.
Definition at line 130 of file CeylanTimestamp.h.
enum Ceylan::TextDisplayable::TextOutputFormat [inherited] |
Defines what text output formats for TextDisplayable instances are available.
Definition at line 124 of file CeylanTextDisplayable.h.
Timestamp::Timestamp | ( | ) |
Creates the timestamp corresponding to the moment when it is called.
UtilsException | if the time could not be obtained. |
Definition at line 59 of file CeylanTimestamp.cc.
References _day, _hour, _minute, _month, _second, _year, Ceylan::System::explainError(), and Ceylan::System::getTime().
Timestamp::~Timestamp | ( | ) | throw () [virtual] |
Ceylan::Timestamp::Timestamp | ( | const Timestamp & | source | ) | [private] |
Copy constructor made private to ensure that it will never be called.
The compiler should complain whenever this undefined constructor is called, implicitly or not.
static std::string Ceylan::Timestamp::DescribeDuration | ( | Ceylan::System::Second | duration | ) | [static] |
Returns a string describing litterally the specied duration.
duration | the duration, in seconds, to describe. |
TextDisplayable::TextOutputFormat TextDisplayable::GetOutputFormat | ( | ) | [static, inherited] |
Returns the current overall text format to be used by TextDisplayable instances.
Definition at line 63 of file CeylanTextDisplayable.cc.
References Ceylan::TextDisplayable::_OutputFormat.
Referenced by Ceylan::formatStringList(), Ceylan::formatStringMap(), Ceylan::XML::XMLMarkup::toString(), Ceylan::Maths::Linear::Vector3::toString(), Ceylan::Maths::Linear::Vector2::toString(), Ceylan::Maths::Linear::Tripoint::toString(), Ceylan::Module::toString(), Ceylan::Maths::Linear::Matrix3::toString(), Ceylan::Maths::Linear::Matrix2::toString(), Ceylan::Maths::Linear::HomogeneousMatrix3::toString(), and Ceylan::Maths::Linear::Bipoint::toString().
bool Timestamp::operator< | ( | Timestamp & | second | ) |
Tells whether this Timestamp's recorded time is strictly inferior to the one of second Timestamp.
Definition at line 292 of file CeylanTimestamp.cc.
References _day, _hour, _minute, _month, _second, _year, generalUtils::false, and generalUtils::true.
Assignment operator made private to ensure that it will never be called.
The compiler should complain whenever this undefined operator is called, implicitly or not.
void TextDisplayable::SetOutputFormat | ( | TextOutputFormat | newOutputFormat | ) | [static, inherited] |
Sets the current overall text format to be used by TextDisplayable instances.
newOutputFormat | the new output format. |
Definition at line 72 of file CeylanTextDisplayable.cc.
References Ceylan::TextDisplayable::_OutputFormat.
Referenced by Ceylan::Log::LogHolder::LogHolder().
const std::string TextDisplayable::ToString | ( | std::list< TextDisplayable * > | displayables, | |
Ceylan::VerbosityLevels | level = Ceylan::high | |||
) | [static, inherited] |
Returns a user-friendly description of this list of pointers to text displayable instances.
displayables | a list of pointers to TextDisplayable instances/ | |
level | the requested verbosity level. |
Definition at line 45 of file CeylanTextDisplayable.cc.
References Ceylan::formatStringList().
const string Timestamp::toString | ( | Ceylan::VerbosityLevels | level = Ceylan::high |
) | const [virtual] |
Returns a user-friendly description of the state of this object.
The timestamp format is [year/month/day hours:minutes:seconds] For instance: [2004/05/07 19:07:54]
Another format could have been the one given by System::timeToString( System::getTime() ) ;
level | the requested verbosity level. |
Implements Ceylan::TextDisplayable.
Definition at line 172 of file CeylanTimestamp.cc.
References _day, _hour, _minute, _month, _second, _year, and Ceylan::toNumericalString().
Referenced by Ceylan::Log::LogAggregatorRaw::aggregate(), Ceylan::Log::LogAggregatorHTML::aggregate(), Ceylan::Log::LogAggregatorConsole::aggregate(), Ceylan::Log::LogMessage::getPreformattedText(), and Ceylan::Log::LogMessage::toString().
DayOfTheMonth Ceylan::Timestamp::_day [protected] |
Timestamp's day.
Definition at line 168 of file CeylanTimestamp.h.
Referenced by operator<(), Timestamp(), and toString().
HourOfTheDay Ceylan::Timestamp::_hour [protected] |
Timestamp's hour.
Definition at line 171 of file CeylanTimestamp.h.
Referenced by operator<(), Timestamp(), and toString().
MinuteOfTheHour Ceylan::Timestamp::_minute [protected] |
Timestamp's minute.
Definition at line 174 of file CeylanTimestamp.h.
Referenced by operator<(), Timestamp(), and toString().
MonthOfTheYear Ceylan::Timestamp::_month [protected] |
Timestamp's month.
Definition at line 165 of file CeylanTimestamp.h.
Referenced by operator<(), Timestamp(), and toString().
TextDisplayable::TextOutputFormat TextDisplayable::_OutputFormat = rawText [static, protected, inherited] |
The text format to be used currently by TextDisplayable instances.
Definition at line 158 of file CeylanTextDisplayable.h.
Referenced by Ceylan::TextDisplayable::GetOutputFormat(), and Ceylan::TextDisplayable::SetOutputFormat().
SecondOfTheMinute Ceylan::Timestamp::_second [protected] |
Timestamp's second.
Definition at line 177 of file CeylanTimestamp.h.
Referenced by operator<(), Timestamp(), and toString().
Year Ceylan::Timestamp::_year [protected] |
Timestamp's year.
Definition at line 162 of file CeylanTimestamp.h.
Referenced by operator<(), Timestamp(), and toString().