From 14c7c59190771720d1d78752bb0edc8d56dd583b Mon Sep 17 00:00:00 2001 From: Steve Brokenshire Date: Thu, 2 Jun 2016 22:50:30 +0100 Subject: [PATCH] Added SEQUENCE property for saving data from a CalendarEventObject. Added the code and unit tests for the SEQUENCE property. --- .../calendarevent/CalendarEvent-Save.cpp | 26 +++++++++++++++++++ source/tests/xestiacalendar_icaleventsave.h | 1 + 2 files changed, 27 insertions(+) diff --git a/source/objects/calendarevent/CalendarEvent-Save.cpp b/source/objects/calendarevent/CalendarEvent-Save.cpp index d993212..432459a 100644 --- a/source/objects/calendarevent/CalendarEvent-Save.cpp +++ b/source/objects/calendarevent/CalendarEvent-Save.cpp @@ -463,6 +463,32 @@ void CalendarEventObject::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:VEVENT\n"; } \ No newline at end of file diff --git a/source/tests/xestiacalendar_icaleventsave.h b/source/tests/xestiacalendar_icaleventsave.h index bc2b843..7cdfd69 100644 --- a/source/tests/xestiacalendar_icaleventsave.h +++ b/source/tests/xestiacalendar_icaleventsave.h @@ -88,6 +88,7 @@ TEST(iCalendarSaveEvent, SaveEventTests){ "ORGANIZER;CN=ExampleOrganiser;DIR=\"null:nodata\";SENT-BY=\"mailto:organiser.nor\n" " eply@example.com\";LANGUAGE=kw;HAPPY=DAYS:mailto:organiser@example.com\n" "PRIORITY;STATUS=DEFAULT:5\n" + "SEQUENCE;TEST=YAY:3\n" "END:VEVENT\n" "END:VCARD"; -- 2.39.5