From: Steve Brokenshire Date: Sun, 5 Jun 2016 21:51:43 +0000 (+0100) Subject: Added DTSTAMP property for saving data from a CalendarJournalObject. X-Git-Tag: release-0.02~197 X-Git-Url: http://Server1/repobrowser/?a=commitdiff_plain;h=568aa1ebd96fbb8b680ee2d5e515c6d5703a63e9;p=xestiacalendar%2F.git Added DTSTAMP property for saving data from a CalendarJournalObject. Added the code and unit tests for the DTSTAMP property. --- diff --git a/source/objects/calendarjournal/CalendarJournal-Save.cpp b/source/objects/calendarjournal/CalendarJournal-Save.cpp index 3a3778a..7235419 100644 --- a/source/objects/calendarjournal/CalendarJournal-Save.cpp +++ b/source/objects/calendarjournal/CalendarJournal-Save.cpp @@ -37,6 +37,34 @@ void CalendarJournalObject::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:VJOURNAL\n"; } \ No newline at end of file diff --git a/source/tests/xestiacalendar_icaljournalsave.h b/source/tests/xestiacalendar_icaljournalsave.h index 08fb513..eb2263b 100644 --- a/source/tests/xestiacalendar_icaljournalsave.h +++ b/source/tests/xestiacalendar_icaljournalsave.h @@ -38,6 +38,7 @@ TEST(iCalendarSaveJournal, SaveEventTests){ "PRODID:-//Xestia//Calendar Unit Testing//KW\n" "BEGIN:VJOURNAL\n" "UID:329128-12939123-123123-13\n" + "DTSTAMP:20160116T190200Z\n" "END:VJOURNAL\n" "END:VCALENDAR";