Home | News | Projects | Releases
Bugs | RFE | Repositories | Help
Added CLASS property for saving data from a CalendarJournalObject.
authorSteve Brokenshire <sbrokenshire@xestia.co.uk>
Sun, 5 Jun 2016 22:10:22 +0000 (23:10 +0100)
committerSteve Brokenshire <sbrokenshire@xestia.co.uk>
Sun, 5 Jun 2016 22:10:22 +0000 (23:10 +0100)
Added the code and unit tests for the CLASS property.

source/objects/calendarjournal/CalendarJournal-Save.cpp
source/tests/xestiacalendar_icaljournalsave.h

index 12578b7..e9651e8 100644 (file)
@@ -106,6 +106,32 @@ void CalendarJournalObject::SaveObjectData(string *SaveData){
                
        }
        
+       // Process the CLASS.
+       
+       if (ClassData.size() > 0){
+               
+               DataLine += "CLASS";
+               
+               if (ClassDataTokens.size() > 0){
+               
+                       DataLine += ";";
+                       DataLine += ClassDataTokens;
+                       
+               }
+               
+               DataLine += ":";
+               DataLine += ClassData;
+               DataLine += "\n";
+               
+               DataLineProcessed = OutputText(&DataLine);
+               
+               *SaveData += DataLineProcessed;
+
+               DataLine.clear();
+               DataLineProcessed.clear();
+               
+       }
+       
        *SaveData += "END:VJOURNAL\n";
        
 }
\ No newline at end of file
index 9561f55..69fcb2e 100644 (file)
@@ -21,6 +21,7 @@
 TEST(iCalendarSaveJournal, SaveEventTests){
 
        CalendarJournalObject TestJournal;
+       CalendarJournalObject TestJournal2;
        
        // Load the test journal information.
        
@@ -51,4 +52,25 @@ TEST(iCalendarSaveJournal, SaveEventTests){
        
        ASSERT_EQ(SaveDataComparison, SaveData);
        
+       SaveData.clear();
+
+       ASSERT_EQ(CALENDAROBJECTLOAD_OK, TestJournal2.LoadFile("iCalendarJournal-Load2.vcf"));
+       ASSERT_EQ(CALENDAROBJECTVALID_OK, TestJournal2.ValidBaseObject());
+
+       TestJournal2.SaveString(&SaveData);
+       
+       SaveDataComparison = "BEGIN:VCALENDAR\n"
+       "VERSION:2.0\n"
+       "PRODID:-//Xestia//Calendar Unit Testing//KW\n"
+       "BEGIN:VJOURNAL\n"
+       "UID;UNIQUEPARAM=CERTAINLY;OKAY=MAYBENOT:b3a16392-ad86-4061-be53-c215af2306c1\n"
+       "DTSTAMP;OTHER=PARAM:20160131T141500Z\n"
+       "SUMMARY;ALTREP=\"null:nodata\";LANGUAGE=kw;FAVOURITE=TOFU;NOTLIKE=NONE:A summar\n"
+       " y of the journal entry.\n"
+       "CLASS;CHOCOLATE=BAR:PUBLIC\n"
+       "END:VJOURNAL\n"
+       "END:VCALENDAR";
+       
+       ASSERT_EQ(SaveDataComparison, SaveData);
+
 }
\ No newline at end of file
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