log4cplus::helpers::Time Class Reference

This class represents a Epoch time with microsecond accuracy. More...

List of all members.

Public Member Functions

 Time (time_t tv_sec, long tv_usec)
 Time (time_t time)
time_t sec () const
 Returns seconds value.
long usec () const
 Returns microseconds value.
void sec (time_t s)
 Sets the seconds value.
void usec (long us)
 Sets the microseconds value.
time_t setTime (struct tm *t)
 Sets this Time using the mktime function.
time_t getTime () const
 Returns this Time as a time_t> value.
void gmtime (struct tm *t) const
 Populates tm using the gmtime() function.
void localtime (struct tm *t) const
 Populates tm using the localtime() function.
log4cplus::tstring getFormattedTime (const log4cplus::tstring &fmt, bool use_gmtime=false) const
 Returns a string with a "formatted time" specified by fmt.
Timeoperator+= (const Time &rhs)
Timeoperator-= (const Time &rhs)
Timeoperator/= (long rhs)
Timeoperator *= (long rhs)

Static Public Member Functions

static Time gettimeofday ()
 Returns the current time using the gettimeofday() method if it is available on the current platform.

Private Member Functions

void build_q_value (log4cplus::tstring &q_str) const
void build_uc_q_value (log4cplus::tstring &uc_q_str) const

Private Attributes

time_t tv_sec
long tv_usec


Detailed Description

This class represents a Epoch time with microsecond accuracy.

Definition at line 45 of file timehelp.h.


Member Function Documentation

static Time log4cplus::helpers::Time::gettimeofday (  )  [static]

Returns the current time using the gettimeofday() method if it is available on the current platform.

(Not on WIN32.)

Referenced by log4cplus::thread::ManualResetEvent::timed_wait().

log4cplus::tstring log4cplus::helpers::Time::getFormattedTime ( const log4cplus::tstring fmt,
bool  use_gmtime = false 
) const

Returns a string with a "formatted time" specified by fmt.

It used the strftime() function to do this.

Look at your platform's strftime() documentation for the formatting options available.

The following additional options are provided:
q - 3 character field that provides milliseconds Q - 7 character field that provides fractional milliseconds.


The documentation for this class was generated from the following file:


Generated on 6 Jan 2011 for OFFIS DCMTK Version 3.6.0 by Doxygen 1.5.1