Home | News | Projects | Releases
Bugs | RFE | Repositories | Help
Added CATEGORIES property for saving data from a CalendarEventObject.
authorSteve Brokenshire <sbrokenshire@xestia.co.uk>
Sat, 4 Jun 2016 17:11:19 +0000 (18:11 +0100)
committerSteve Brokenshire <sbrokenshire@xestia.co.uk>
Sat, 4 Jun 2016 17:11:19 +0000 (18:11 +0100)
Added the code and unit tests for the CATEGORIES property.

source/objects/calendarevent/CalendarEvent-Save.cpp
source/tests/xestiacalendar_icaleventsave.h

index ce47518..a2139fc 100644 (file)
@@ -813,6 +813,44 @@ void CalendarEventObject::SaveObjectData(string *SaveData){
                        
        }
        
+       // Process the CATEGORIES value.
+       
+       if (CategoriesList.size() > 0){
+               
+               for (int CategoriesListSeek = 0; CategoriesListSeek < CategoriesList.size();
+                       CategoriesListSeek++){
+       
+                       DataLine += "CATEGORIES";
+                               
+                       if (CategoriesListLanguage[CategoriesListSeek].size() > 0){
+               
+                               DataLine += ";LANGUAGE=";
+                               DataLine += CategoriesListLanguage[CategoriesListSeek];
+                       
+                       }                       
+                       
+                       if (CategoriesListTokens[CategoriesListSeek].size() > 0){
+               
+                               DataLine += ";";
+                               DataLine += CategoriesListTokens[CategoriesListSeek];
+                       
+                       }
+                               
+                       DataLine += ":";
+                       DataLine += CategoriesList[CategoriesListSeek];
+                       DataLine += "\n";
+               
+                       DataLineProcessed = OutputText(&DataLine);
+               
+                       *SaveData += DataLineProcessed;
+
+                       DataLine.clear();
+                       DataLineProcessed.clear();
+                               
+               }
+               
+       }
+       
        *SaveData += "END:VEVENT\n";
        
 }
\ No newline at end of file
index 761819e..2858f3f 100644 (file)
@@ -106,6 +106,10 @@ TEST(iCalendarSaveEvent, SaveEventTests){
        "ATTENDEE;DIR=\"null:nodata\";SENT-BY=\"mailto:sent.by@example.com\";CN=\"Attendee \n"
        " The Third\";CUTYPE=INDIVIDUAL;PARTSTAT=ACCEPTED;LANGUAGE=kw;EXAMPLE=DATA:Atte\n"
        " ndee Three\n"
+       "CATEGORIES:CATEGORY ONE, CATEGORY TWO\n"
+       "CATEGORIES;LANGUAGE=en:CATEGORY THREE, CATEGORY FOUR\n"
+       "CATEGORIES;LANGUAGE=en-GB;SAMPLE=TOKEN:CATEGORY FIVE, CATEGORY SIX, CATEGORY \n"
+       " SEVEN\n"
        "END:VEVENT\n"
        "END:VCARD";
 
Xestia Software Development
Yn Maystri
© 2006 - 2019 Xestia Software Development
Software

Xestia Address Book
Xestia Calendar
Development

Xestia Gelforn
Everything else

About
News
Privacy Policy