From 3b462406bd52d9c05c86d2099ec9ffaaa7f2de95 Mon Sep 17 00:00:00 2001 From: Steve Brokenshire Date: Thu, 2 Jun 2016 21:54:44 +0100 Subject: [PATCH] Added LAST-MODIFIED property for saving data from a CalendarEventObject. Added the code and unit tests for the LAST-MODIFIED property. --- .../calendarevent/CalendarEvent-Save.cpp | 28 +++++++++++++++++++ source/tests/xestiacalendar_icaleventsave.h | 1 + 2 files changed, 29 insertions(+) diff --git a/source/objects/calendarevent/CalendarEvent-Save.cpp b/source/objects/calendarevent/CalendarEvent-Save.cpp index ceeb1c4..a5afcd5 100644 --- a/source/objects/calendarevent/CalendarEvent-Save.cpp +++ b/source/objects/calendarevent/CalendarEvent-Save.cpp @@ -312,6 +312,34 @@ void CalendarEventObject::SaveObjectData(string *SaveData){ } + // Process the LAST-MODIFIED value. + + if (LastModifiedData.size() > 0){ + + if (LastModifiedTokens.size() > 0){ + + DataLine += "LAST-MODIFIED;"; + DataLine += LastModifiedTokens; + + } else { + + DataLine += "LAST-MODIFIED"; + + } + + DataLine += ":"; + DataLine += LastModifiedData; + DataLine += "\n"; + + DataLineProcessed = OutputText(&DataLine); + + *SaveData += DataLineProcessed; + + DataLine.clear(); + DataLineProcessed.clear(); + + } + *SaveData += "END:VEVENT\n"; } \ No newline at end of file diff --git a/source/tests/xestiacalendar_icaleventsave.h b/source/tests/xestiacalendar_icaleventsave.h index b365b11..dcb07be 100644 --- a/source/tests/xestiacalendar_icaleventsave.h +++ b/source/tests/xestiacalendar_icaleventsave.h @@ -83,6 +83,7 @@ TEST(iCalendarSaveEvent, SaveEventTests){ "DESCRIPTION;ALTREP=\"null:nodata\";LANGUAGE=kw;EXAMPLE=TOKEN;MOREDATA=YES:This \n" " is a description of the event.\n" "GEO;EXAMPLE=MEEP:5.0;5.0\n" + "LAST-MODIFIED;FUTURE=ODD:20160124T093000Z\n" "END:VEVENT\n" "END:VCARD"; -- 2.39.5