From: Steve Brokenshire Date: Sun, 5 Jun 2016 13:33:13 +0000 (+0100) Subject: Added DTSTAMP property for saving data from a CalendarFreeBusyObject. X-Git-Tag: release-0.02~210 X-Git-Url: http://Server1/repobrowser/?p=xestiacalendar%2F.git;a=commitdiff_plain;h=1ed7195c8d0b26b0deeab4646a1445c60de5d56c Added DTSTAMP property for saving data from a CalendarFreeBusyObject. Added the code and unit tests for the DTSTAMP property. --- 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";