From 6e6ccf0ee2b75766757cb60895afcc9c75691e2d Mon Sep 17 00:00:00 2001 From: Steve Brokenshire Date: Sun, 5 Jun 2016 23:25:41 +0100 Subject: [PATCH] Added SEQUENCE property for saving data from a CalendarJournalObject. Added the code and unit tests for the SEQUENCE property. --- .../calendarjournal/CalendarJournal-Save.cpp | 26 +++++++++++++++++++ source/tests/xestiacalendar_icaljournalsave.h | 1 + 2 files changed, 27 insertions(+) diff --git a/source/objects/calendarjournal/CalendarJournal-Save.cpp b/source/objects/calendarjournal/CalendarJournal-Save.cpp index 2b357fa..44924cc 100644 --- a/source/objects/calendarjournal/CalendarJournal-Save.cpp +++ b/source/objects/calendarjournal/CalendarJournal-Save.cpp @@ -303,6 +303,32 @@ void CalendarJournalObject::SaveObjectData(string *SaveData){ } + // Process the SEQUENCE value. + + if (SequenceData > -1 && SequenceData < 10){ + + DataLine += "SEQUENCE"; + + if (SequenceTokens.size() > 0){ + + DataLine += ";"; + DataLine += SequenceTokens; + + } + + DataLine += ":"; + DataLine += to_string(SequenceData); + 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 f60bf8e..13f149b 100644 --- a/source/tests/xestiacalendar_icaljournalsave.h +++ b/source/tests/xestiacalendar_icaljournalsave.h @@ -75,6 +75,7 @@ TEST(iCalendarSaveJournal, SaveEventTests){ " eply@example.com\";LANGUAGE=kw;HAPPY=DAYS:mailto:organiser@example.com\n" "RECURRENCE-ID;TZID=Europe/Truro;RANGE=THISANDFUTURE;VALUE=DATE;EXAMPLE=DATA:2\n" " 0160131\n" + "SEQUENCE;TEST=YAY:7\n" "END:VJOURNAL\n" "END:VCALENDAR"; -- 2.39.5