From 1ed7195c8d0b26b0deeab4646a1445c60de5d56c Mon Sep 17 00:00:00 2001 From: Steve Brokenshire Date: Sun, 5 Jun 2016 14:33:13 +0100 Subject: [PATCH] Added DTSTAMP property for saving data from a CalendarFreeBusyObject. Added the code and unit tests for the DTSTAMP property. --- .../CalendarFreeBusy-Save.cpp | 28 +++++++++++++++++++ .../tests/xestiacalendar_icalfreebusysave.h | 1 + 2 files changed, 29 insertions(+) diff --git a/source/objects/calendarfreebusy/CalendarFreeBusy-Save.cpp b/source/objects/calendarfreebusy/CalendarFreeBusy-Save.cpp index 9746eca..aed39d8 100644 --- a/source/objects/calendarfreebusy/CalendarFreeBusy-Save.cpp +++ b/source/objects/calendarfreebusy/CalendarFreeBusy-Save.cpp @@ -37,6 +37,34 @@ void CalendarFreeBusyObject::SaveObjectData(string *SaveData){ } + // Process the DTSTAMP. + + if (DateTimeStampData.size() > 0){ + + if (DateTimeStampTokens.size() > 0){ + + DataLine += "DTSTAMP;"; + DataLine += DateTimeStampTokens; + + } else { + + DataLine += "DTSTAMP"; + + } + + DataLine += ":"; + DataLine += DateTimeStampData; + DataLine += "\n"; + + DataLineProcessed = OutputText(&DataLine); + + *SaveData += DataLineProcessed; + + DataLine.clear(); + DataLineProcessed.clear(); + + } + *SaveData += "END:VFREEBUSY\n"; } \ No newline at end of file diff --git a/source/tests/xestiacalendar_icalfreebusysave.h b/source/tests/xestiacalendar_icalfreebusysave.h index cb5e02b..6b30f1a 100644 --- a/source/tests/xestiacalendar_icalfreebusysave.h +++ b/source/tests/xestiacalendar_icalfreebusysave.h @@ -36,6 +36,7 @@ TEST(iCalendarSaveFreeBusy, SaveFreeBusyTests){ "PRODID:-//Xestia//Calendar Unit Testing//KW\n" "BEGIN:VFREEBUSY\n" "UID:60\n" + "DTSTAMP:20160131T165000Z\n" "END:VFREEBUSY\n" "END:VCALENDAR"; -- 2.39.5