From: Steve Brokenshire Date: Wed, 1 Jun 2016 21:07:20 +0000 (+0100) Subject: Added CREATED value for saving data from a CalendarEventObject. X-Git-Tag: release-0.02~248 X-Git-Url: http://Server1/repobrowser/?a=commitdiff_plain;h=6b1023322f3c0d967816c6b4436de3ff1b22e89c;p=xestiacalendar%2F.git Added CREATED value for saving data from a CalendarEventObject. Added the code and unit tests for the CREATED value. --- diff --git a/source/objects/calendarevent/CalendarEvent-Save.cpp b/source/objects/calendarevent/CalendarEvent-Save.cpp index 1d1edcc..ee48352 100644 --- a/source/objects/calendarevent/CalendarEvent-Save.cpp +++ b/source/objects/calendarevent/CalendarEvent-Save.cpp @@ -186,7 +186,7 @@ void CalendarEventObject::SaveObjectData(string *SaveData){ } - // Process the CLASS. + // Process the CLASS value. if (ClassData.size() > 0){ @@ -214,6 +214,34 @@ void CalendarEventObject::SaveObjectData(string *SaveData){ } + // Process the CREATED value. + + if (DateTimeCreatedData.size() > 0){ + + if (DateTimeCreatedTokens.size() > 0){ + + DataLine += "CREATED;"; + DataLine += DateTimeCreatedTokens; + + } else { + + DataLine += "CREATED"; + + } + + DataLine += ":"; + DataLine += DateTimeCreatedData; + 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 2e2ffbf..41e07a8 100644 --- a/source/tests/xestiacalendar_icaleventsave.h +++ b/source/tests/xestiacalendar_icaleventsave.h @@ -79,6 +79,7 @@ TEST(iCalendarSaveEvent, SaveEventTests){ "SUMMARY;ALTREP=\"null:nodata\";LANGUAGE=kw;FAVOURITE=TOFU;NOTLIKE=NONE:A summar\n" " y of the event.\n" "CLASS;CHOCOLATE=BAR:PUBLIC\n" + "CREATED;CARAMEL=PLEASE:20160123T081100Z\n" "END:VEVENT\n" "END:VCARD";