From: Steve Brokenshire Date: Sun, 5 Jun 2016 17:19:03 +0000 (+0100) Subject: Added URL property for saving data from a CalendarFreeBusyObject. X-Git-Tag: release-0.02~205 X-Git-Url: http://Server1/repobrowser/?a=commitdiff_plain;h=25b00fe5680382f26a0d18a0d5ddb26cacdf221d;p=xestiacalendar%2F.git Added URL property for saving data from a CalendarFreeBusyObject. Added the code and unit tests for the URL property. --- diff --git a/source/objects/calendarfreebusy/CalendarFreeBusy-Save.cpp b/source/objects/calendarfreebusy/CalendarFreeBusy-Save.cpp index 46c09ac..e60db34 100644 --- a/source/objects/calendarfreebusy/CalendarFreeBusy-Save.cpp +++ b/source/objects/calendarfreebusy/CalendarFreeBusy-Save.cpp @@ -246,6 +246,32 @@ void CalendarFreeBusyObject::SaveObjectData(string *SaveData){ } + // Process the URL value. + + if (URLData.size() > 0){ + + DataLine += "URL"; + + if (URLDataTokens.size() > 0){ + + DataLine += ";"; + DataLine += URLDataTokens; + + } + + DataLine += ":"; + DataLine += URLData; + DataLine += "\n"; + + DataLineProcessed = OutputText(&DataLine); + + *SaveData += DataLineProcessed; + + DataLine.clear(); + DataLineProcessed.clear(); + + } + *SaveData += "END:VFREEBUSY\n"; } \ No newline at end of file diff --git a/source/tests/xestiacalendar_icalfreebusysave.h b/source/tests/xestiacalendar_icalfreebusysave.h index 6b92a0f..dd28e96 100644 --- a/source/tests/xestiacalendar_icalfreebusysave.h +++ b/source/tests/xestiacalendar_icalfreebusysave.h @@ -65,6 +65,7 @@ TEST(iCalendarSaveFreeBusy, SaveFreeBusyTests){ " 183000Z\n" "ORGANIZER;CN=ExampleOrganiser;DIR=\"null:nodata\";SENT-BY=\"mailto:organiser.nor\n" " eply@example.com\";LANGUAGE=kw;HAPPY=DAYS:mailto:organiser@example.com\n" + "URL;EXTERNAL=YES:http://www.example.com/\n" "END:VFREEBUSY\n" "END:VCALENDAR";