From e0319715f40f4306e03fb1b29e6fd95f365407cb Mon Sep 17 00:00:00 2001 From: Steve Brokenshire Date: Sun, 5 Jun 2016 23:28:18 +0100 Subject: [PATCH] Added STATUS property for saving data from a CalendarJournalObject. Added the code and unit tests for the STATUS property. --- .../calendarjournal/CalendarJournal-Save.cpp | 33 +++++++++++++++++++ source/tests/xestiacalendar_icaljournalsave.h | 1 + 2 files changed, 34 insertions(+) diff --git a/source/objects/calendarjournal/CalendarJournal-Save.cpp b/source/objects/calendarjournal/CalendarJournal-Save.cpp index 44924cc..0c18ae0 100644 --- a/source/objects/calendarjournal/CalendarJournal-Save.cpp +++ b/source/objects/calendarjournal/CalendarJournal-Save.cpp @@ -329,6 +329,39 @@ void CalendarJournalObject::SaveObjectData(string *SaveData){ } + // Process the STATUS value. + + if (StatusData.size() > 0){ + + DataLine += "STATUS"; + + if (StatusLanguage.size() > 0){ + + DataLine += ";LANGUAGE="; + DataLine += StatusLanguage; + + } + + if (StatusTokens.size() > 0){ + + DataLine += ";"; + DataLine += StatusTokens; + + } + + DataLine += ":"; + DataLine += StatusData; + 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 13f149b..6906295 100644 --- a/source/tests/xestiacalendar_icaljournalsave.h +++ b/source/tests/xestiacalendar_icaljournalsave.h @@ -76,6 +76,7 @@ TEST(iCalendarSaveJournal, SaveEventTests){ "RECURRENCE-ID;TZID=Europe/Truro;RANGE=THISANDFUTURE;VALUE=DATE;EXAMPLE=DATA:2\n" " 0160131\n" "SEQUENCE;TEST=YAY:7\n" + "STATUS;LANGUAGE=kw;FAVOURITE=RICHTEA;NOTLIKE=UNKNOWN:2.0;Success\n" "END:VJOURNAL\n" "END:VCALENDAR"; -- 2.39.5