# Barry::Sync::vTimeConverter Class Reference

`#include <vbase.h>`

List of all members.

## Detailed Description

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.

## 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.

## Member Function Documentation

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.

Definition at line 40 of file vbase.cc.

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().

Here is the call graph for this function:

int Barry::Sync::vTimeConverter::alarmduration2sec | ( | const char * | alarm | ) | `[virtual]`

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.

Definition at line 72 of file vbase.cc.

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

- vbase.h
- vbase.cc