From 1a35c1eb7ce39b07bc04fda09eb2b90cbf18c09b Mon Sep 17 00:00:00 2001 From: Dan Goodliffe Date: Tue, 9 Dec 2014 16:50:31 +0000 Subject: Tweaks for using slicer --- p2pvr/ice/Jamfile.jam | 3 +-- p2pvr/ice/converters.cpp | 14 ++++++++++++++ p2pvr/ice/dvbsi.ice | 4 ++++ 3 files changed, 19 insertions(+), 2 deletions(-) diff --git a/p2pvr/ice/Jamfile.jam b/p2pvr/ice/Jamfile.jam index 494988f..5720bf1 100644 --- a/p2pvr/ice/Jamfile.jam +++ b/p2pvr/ice/Jamfile.jam @@ -1,7 +1,7 @@ +lib slicer : : : : /usr/include/slicer ; lib Ice ; lib IceUtil ; lib pthread ; -lib slicer ; lib p2pvrice : [ glob *.cpp *.ice ] : @@ -13,7 +13,6 @@ lib p2pvrice : ..//p2ice slicer yes - /usr/include/slicer/ : : . Ice diff --git a/p2pvr/ice/converters.cpp b/p2pvr/ice/converters.cpp index 94f2353..23861f8 100644 --- a/p2pvr/ice/converters.cpp +++ b/p2pvr/ice/converters.cpp @@ -30,4 +30,18 @@ IceConvert::FromVariable(const VariableType & d) { return *d.as(); } + +namespace Slicer { + Common::DateTime + ptimeToDateTime(boost::posix_time::ptime const & p) + { + return *p; + } + + boost::posix_time::ptime + dateTimeToPTime(Common::DateTime const & c) + { + return *c; + } +} diff --git a/p2pvr/ice/dvbsi.ice b/p2pvr/ice/dvbsi.ice index 7978d3f..29e5396 100644 --- a/p2pvr/ice/dvbsi.ice +++ b/p2pvr/ice/dvbsi.ice @@ -1,6 +1,8 @@ #ifndef DVISI_ICE #define DVISI_ICE +[["cpp:include:boost/date_time/posix_time/posix_time_types.hpp"]] + #include "common.ice" // This attempts to define an ICE representation of domain objects contained @@ -131,7 +133,9 @@ module DVBSI { optional(1) string Subtitle; optional(2) string Description; optional(3) string DescriptionLang; + [ "slicer:conversion:boost.posix_time.ptime:ptimeToDateTime:dateTimeToPTime" ] Common::DateTime StartTime; + [ "slicer:conversion:boost.posix_time.ptime:ptimeToDateTime:dateTimeToPTime" ] Common::DateTime StopTime; optional(4) short Episode; optional(5) short Episodes; -- cgit v1.2.3