class PsiTime

Psion time related utility class. More...

Definition#include <psitime.h>
List of all Methods
Annotated List
Files
Globals
Hierarchy
Index

Public Types

Public Methods


Detailed Description

Psion time related utility class.

PsiTime provides easy access to the time format, used when communicating with a Psion. Internally, the time is always normalized to GMT. The time value can be set and retrieved in both Unix and Psion formats. This allows easy conversion between both formats. NOTE: For proper conversion, the current timezone of the Psion has to be set. For EPOC devices, the timezone can be evaluated using rpcs::getMachineInfo . For SIBO devices, unfortunately there is no known method of retrieving this information. Therefore, if the timezone is not set, a fallback using the environment variable PSI_TZ is provided. Users should set this variable to the offset of their time zone in seconds. If PSI_TZ is net set, a second fallback uses the local machine's setup, which assumes that both Psion and local machine have the same time zone and daylight settings.

 PsiTime (struct timeval *_utv, struct timezone *_utz = 0L)

PsiTime

Contructs a new instance.

Parameters:
_utvA Unix time value for initialization.
_utzA Unix timezone for initialization.

 PsiTime (time_t time)

PsiTime

Contructs a new instance.

Parameters:
timeA Unix time value for initialization.

 PsiTime (psi_timeval *_ptv, psi_timezone *_ptz = 0L)

PsiTime

Contructs a new instance.

Parameters:
_ptvA Psion time value for initialization.
_ptzA Psion timezone for initialization.

 PsiTime (const u_int32_t _ptvHi, const u_int32_t _ptvLo)

PsiTime

Contructs a new instance.

Parameters:
_ptvHiThe high 32 bits of a Psion time value for initialization.
_ptvLoThe low 32 bits of a Psion time value for initialization.

 PsiTime (void)

PsiTime

Constructs a new instance, initializing to now.

 PsiTime (const PsiTime &t)

PsiTime

A copy-constructor

 ~PsiTime ()

~PsiTime

Destroys the instance.

void  setPsiTime (psi_timeval *_ptv)

setPsiTime

Modifies the value of this instance.

Parameters:
_ptvThe new Psion time representation.

void  setSiboTime (u_int32_t stime)

setSiboTime

Modifies the value of this instance.

Parameters:
stimeThe new SIBO time representation.

void  setPsiTime (const u_int32_t _ptvHi, const u_int32_t _ptvLo)

setPsiTime

Modifies the value of this instance.

Parameters:
_ptvHiThe high 32 bits of a Psion time.
_ptvLoThe low 32 bits of a Psion time.

void  setPsiZone (psi_timezone *_ptz)

setPsiZone

Sets the Psion time zone of this instance.

Parameters:
_ptzThe new Psion time zone.

void  setUnixTime (struct timeval *_utv)

setUnixTime

Sets the value of this instance.

Parameters:
_utvThe new Unix time representation.

void  setUnixTime (time_t time)

setUnixTime

Sets the value of this instance.

Parameters:
_utvThe new Unix time representation.

void  setUnixNow (void)

setUnixNow

Sets the value of this instance to the current time of the Unix machine.

struct timeval & getTimeval (void)

getTimeval

Retrieves the instance's current value in Unix time format.

Returns: The instance's current time as Unix struct timeval.

time_t  getTime (void)

getTime

Retrieves the instance's current value in Unix time format.

Returns: The instance's current time as Unix time_t.

u_int32_t  getSiboTime ()

getSiboTime

Retrieves the instance's current value in SIBO time format.

Returns: The instance's current time as SIBO time.

psi_timeval & getPsiTimeval (void)

getPsiTimeval

Retrieves the instance's current value in Psion time format.

Returns: The instance's current time a Psion struct psi_timeval_t.

const u_int32_t  getPsiTimeLo (void)

getPsiTimeLo

Retrieves the instance's current value in Psion time format, high 32 bits.

Returns: The instance's current time as lower 32 bits of a Psion struct psi_timeval_t.

const u_int32_t  getPsiTimeHi (void)

getPsiTimeHi

Retrieves the instance's current value in Psion time format, low 32 bits.

Returns: The instance's current time as upper 32 bits of a Psion struct psi_timeval_t.

friend std::ostream & operator<< (std::ostream &s, const PsiTime &t)

operator<<

Prints the instance's value in human readable format. This function uses the current locale setting for formatting the time.

Parameters:
sThe stream to be written.
tThe instance whose value should be displayed.

Returns: The stream.

PsiTimeoperator= (const PsiTime &t)

operator=

Assignment operator

bool  operator== (const PsiTime &t)

operator==

Comparison operators

bool  operator< (const PsiTime &t)

operator<

bool  operator> (const PsiTime &t)

operator>

enum zone { PSI_TZ_NONE = 0, PSI_TZ_EUROPEAN = 1, PSI_TZ_NORTHERN = 2, PSI_TZ_SOUTHERN = 4, PSI_TZ_HOME = 0x40000000 }

zone