eyedb::ClockConverter Class Reference

An utility class that performs some clock conversion from and to the usec (microsecond) time. More...

#include <ClockConverter.h>

List of all members.

Public Member Functions

 ClockConverter ()
virtual ~ClockConverter ()
void usec2clock (const eyedblib::int64 usec, eyedblib::int16 *hour=0, eyedblib::int16 *min=0, eyedblib::int16 *sec=0, eyedblib::int16 *ms=0, eyedblib::int16 *us=0)
 Computes the clock time from the usec time.
void clock2usec (eyedblib::int64 *usec, const eyedblib::int16 hour=0, const eyedblib::int16 min=0, const eyedblib::int16 sec=0, const eyedblib::int16 ms=0, const eyedblib::int16 us=0)
 Computes the usec time from the clock.
eyedblib::int32 usec2day (eyedblib::int64 usec)
 Convert an usec time into days.
void tz2clock (const eyedblib::int16 tz, eyedblib::int16 *hour, eyedblib::int16 *min)
 Computes timezone (minute) -> (hour,minute).
void clock2tz (eyedblib::int16 *tz, const eyedblib::int16 hour, const eyedblib::int16 min)
 Computes (hour, minute) -> timezone (minute).
eyedblib::int64 ascii2usec (const char *t)
 Convert a string time into an usec time.
char * usec2ascii (const eyedblib::int64 usec)
 Convert an usec time in ascii format (same as in ascii2usec).
eyedblib::int16 ascii2tz (const char *tz)
 Convert a string into a timezone value.
char * tz2ascii (const eyedblib::int16 tz)
 Convert a timezone value in ascii format (same as in ascii2tz).
eyedblib::int64 current_time ()
 Gets the current GMT time.
eyedblib::int16 local_timezone ()
 Gets the local timezone.


Detailed Description

An utility class that performs some clock conversion from and to the usec (microsecond) time.

This is an abstract class.

Definition at line 39 of file ClockConverter.h.


Member Function Documentation

void eyedb::ClockConverter::usec2clock ( const eyedblib::int64  usec,
eyedblib::int16 hour = 0,
eyedblib::int16 min = 0,
eyedblib::int16 sec = 0,
eyedblib::int16 ms = 0,
eyedblib::int16 us = 0 
)

Computes the clock time from the usec time.

Parameters:
usec The elapsed microseconds since 00:00h
hour The returned hour (0->23)
min The returned minute (0->60)
sec The returned second (0->60)
ms The returned millisecond (0->999)
us The returned microsecond (0->999)

Definition at line 83 of file ClockConverter.cc.

void eyedb::ClockConverter::clock2usec ( eyedblib::int64 usec,
const eyedblib::int16  hour = 0,
const eyedblib::int16  min = 0,
const eyedblib::int16  sec = 0,
const eyedblib::int16  ms = 0,
const eyedblib::int16  us = 0 
)

Computes the usec time from the clock.

Parameters:
usec The elapsed microseconds since 00:00h
hour The hour (0->23)
min The minute (0->60)
sec The second (0->60)
ms The millisecond (0->999)
us The microsecond (0->999)

Definition at line 120 of file ClockConverter.cc.

eyedblib::int32 eyedb::ClockConverter::usec2day ( eyedblib::int64  usec  ) 

Convert an usec time into days.

Parameters:
usec The time in microsecond
Returns:
The number of days into usec

Definition at line 132 of file ClockConverter.cc.

eyedblib::int64 eyedb::ClockConverter::ascii2usec ( const char *  t  ) 

Convert a string time into an usec time.

This method is not thread-safe.

Parameters:
t The string time in the format HH:MM[:ss[,mmm[,uuu]]]
Returns:
The usec time or 0 if the string is not valid.

Definition at line 165 of file ClockConverter.cc.

char * eyedb::ClockConverter::usec2ascii ( const eyedblib::int64  usec  ) 

Convert an usec time in ascii format (same as in ascii2usec).

The client must deallocate (delete) the returned string.

Definition at line 241 of file ClockConverter.cc.

eyedblib::int16 eyedb::ClockConverter::ascii2tz ( const char *  tz  ) 

Convert a string into a timezone value.

This method is not thread-safe.

Parameters:
tz The string timezone in the format GMT(+|-)HH[:MM]
Returns:
The timezone value or 0 if the string is not valid.

Definition at line 260 of file ClockConverter.cc.

char * eyedb::ClockConverter::tz2ascii ( const eyedblib::int16  tz  ) 

Convert a timezone value in ascii format (same as in ascii2tz).

The client must deallocate (delete) the returned string.

Definition at line 328 of file ClockConverter.cc.

eyedblib::int16 eyedb::ClockConverter::local_timezone (  ) 

Gets the local timezone.

Returns:
The local timezone in minutes

Definition at line 375 of file ClockConverter.cc.


The documentation for this class was generated from the following files:
Generated on Mon Dec 22 18:16:23 2008 for eyedb by  doxygen 1.5.3