A virtual base class that the plugins may override, to do time related conversions. More...
#include <vbase.h>
Public Member Functions | |
virtual std::string | unix2vtime (const time_t *timestamp) |
Convert a time_t into an ISO timestamp string Throws Barry::ConvertError on error, but these errors must be rare. | |
virtual time_t | vtime2unix (const char *vtime) |
Convert an ISO timestamp string into a time_t, using the current system timezone if vtime is not in UTC. | |
virtual int | alarmduration2sec (const char *alarm) |
Convert a VEVENT alarm duration string in the format of "[+-]P.W.DT.H.M.S" where the periods represent numbers and each letter besides P and T represent Week, Day, Hour, Minute, and Second respectively. |
A virtual base class that the plugins may override, to do time related conversions.
Default implementations for these functions are provided, but may be overrided depending on need.
We do this in a "callback" style, so that it doesn't matter what version of the opensync library we link against, in case the user wishes to use the opensync time functions.
Definition at line 44 of file vbase.h.
int Barry::Sync::vTimeConverter::alarmduration2sec | ( | const char * | alarm | ) | [virtual] |
std::string Barry::Sync::vTimeConverter::unix2vtime | ( | const time_t * | timestamp | ) | [virtual] |
Convert a time_t into an ISO timestamp string Throws Barry::ConvertError on error, but these errors must be rare.
time_t Barry::Sync::vTimeConverter::vtime2unix | ( | const char * | vtime | ) | [virtual] |
Convert an ISO timestamp string into a time_t, using the current system timezone if vtime is not in UTC.
Returns (time_t)-1 on error.
Definition at line 56 of file vbase.cc.
References Barry::Sync::TzWrapper::iso_mktime().