From ead23660569625b5c84ce4bc7d98ca4e30aa897f Mon Sep 17 00:00:00 2001 From: Steve Brokenshire Date: Sun, 5 Jun 2016 22:54:03 +0100 Subject: [PATCH] Added SUMMARY property for saving data from a CalendarJournalObject. Added the code and unit tests for the SUMMARY property. --- .../calendarjournal/CalendarJournal-Save.cpp | 41 +++++++++++++++++++ source/tests/xestiacalendar_icaljournalsave.h | 3 ++ 2 files changed, 44 insertions(+) diff --git a/source/objects/calendarjournal/CalendarJournal-Save.cpp b/source/objects/calendarjournal/CalendarJournal-Save.cpp index 7235419..12578b7 100644 --- a/source/objects/calendarjournal/CalendarJournal-Save.cpp +++ b/source/objects/calendarjournal/CalendarJournal-Save.cpp @@ -65,6 +65,47 @@ void CalendarJournalObject::SaveObjectData(string *SaveData){ } + // Process the SUMMARY. + + if (SummaryData.size() > 0){ + + DataLine += "SUMMARY"; + + if (SummaryDataAltRep.size() > 0){ + + DataLine += ";ALTREP=\""; + DataLine += SummaryDataAltRep; + DataLine += "\""; + + } + + if (SummaryDataLanguage.size() > 0){ + + DataLine += ";LANGUAGE="; + DataLine += SummaryDataLanguage; + + } + + if (SummaryDataTokens.size() > 0){ + + DataLine += ";"; + DataLine += SummaryDataTokens; + + } + + DataLine += ":"; + DataLine += SummaryData; + 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 eb2263b..9561f55 100644 --- a/source/tests/xestiacalendar_icaljournalsave.h +++ b/source/tests/xestiacalendar_icaljournalsave.h @@ -39,6 +39,9 @@ TEST(iCalendarSaveJournal, SaveEventTests){ "BEGIN:VJOURNAL\n" "UID:329128-12939123-123123-13\n" "DTSTAMP:20160116T190200Z\n" + "SUMMARY:Unit Test Event 1 which has to be a really long summary as we don't k\n" + " now if multiple line processing is going to work without it. I mean seriousl\n" + " y, how annoying can this potentially be?\n" "END:VJOURNAL\n" "END:VCALENDAR"; -- 2.39.2