Home | News | Projects | Releases
Bugs | RFE | Repositories | Help
Added SaveObjectData for CalendarEventObject
authorSteve Brokenshire <sbrokenshire@xestia.co.uk>
Tue, 31 May 2016 06:30:50 +0000 (07:30 +0100)
committerSteve Brokenshire <sbrokenshire@xestia.co.uk>
Tue, 31 May 2016 06:30:50 +0000 (07:30 +0100)
source/objects/calendarevent/CalendarEvent-Save.cpp [new file with mode: 0644]
source/objects/calendarevent/CalendarEvent.h

diff --git a/source/objects/calendarevent/CalendarEvent-Save.cpp b/source/objects/calendarevent/CalendarEvent-Save.cpp
new file mode 100644 (file)
index 0000000..911947b
--- /dev/null
@@ -0,0 +1,193 @@
+#include "CalendarEvent.h"
+
+using namespace std;
+
+void CalendarEventObject::SaveObjectData(string *SaveData){
+
+       string DataLine = "";
+       string DataLineProcessed = "";
+       
+       *SaveData += "BEGIN:VEVENT\n";
+       
+       // TODO: Replace SaveData with DataLine, DataLineProcessed
+       // and use the new OutputText function.
+       
+       // Process the UID.
+       
+       if (UniqueID.size() > 0){
+               
+               if (UniqueIDTokens.size() > 0){
+               
+                       DataLine += "UID;";
+                       DataLine += UniqueIDTokens;
+                       
+               } else {
+
+                       DataLine += "UID";
+                       
+               }
+
+               DataLine += ":";
+               DataLine += UniqueID;
+               DataLine += "\n";
+               
+               DataLineProcessed = OutputText(&DataLine);
+               
+               *SaveData += DataLineProcessed;
+               
+               DataLine.clear();
+               DataLineProcessed.clear();
+               
+       }
+       
+       // Process the DTSTAMP.
+       
+       if (DateTimeStampData.size() > 0){
+               
+               if (DateTimeStampTokens.size() > 0){
+               
+                       DataLine += "DTSTAMP;";
+                       DataLine += DateTimeStampTokens;
+                       
+               } else {
+
+                       DataLine += "DTSTAMP";
+                       
+               }
+
+               DataLine += ":";
+               DataLine += DateTimeStampData;
+               DataLine += "\n";
+               
+               DataLineProcessed = OutputText(&DataLine);
+               
+               *SaveData += DataLineProcessed;
+               
+               DataLine.clear();
+               DataLineProcessed.clear();
+               
+       }
+
+       // Process the DTSTART.
+       
+       if (DateTimeStartData.size() > 0){
+               
+               DataLine += "DTSTART";
+               
+               if (DateTimeStartDataValue.size() > 0){
+               
+                       DataLine += ";VALUE=";
+                       DataLine += DateTimeStartDataValue;                     
+                       
+               }
+               
+               if (DateTimeStartDataTimeZoneID.size() > 0){
+               
+                       DataLine += ";TZID=";
+                       DataLine += DateTimeStartDataTimeZoneID;                        
+                       
+               }
+               
+               if (DateTimeStartDataTokens.size() > 0){
+               
+                       DataLine += ";";
+                       DataLine += DateTimeStartDataTokens;
+                       
+               }
+
+               DataLine += ":";
+               DataLine += DateTimeStartData;
+               DataLine += "\n";
+               
+               DataLineProcessed = OutputText(&DataLine);
+               
+               *SaveData += DataLineProcessed;
+               
+               DataLine.clear();
+               DataLineProcessed.clear();
+               
+       }
+       
+       // Process the DTEND.
+       
+       if (DateTimeStartData.size() > 0){
+               
+               DataLine += "DTEND";
+               
+               if (DateTimeStartDataValue.size() > 0){
+               
+                       DataLine += ";VALUE=";
+                       DataLine += DateTimeStartDataValue;                     
+                       
+               }
+               
+               if (DateTimeStartDataTimeZoneID.size() > 0){
+               
+                       DataLine += ";TZID=";
+                       DataLine += DateTimeStartDataTimeZoneID;                        
+                       
+               }
+               
+               if (DateTimeStartDataTokens.size() > 0){
+               
+                       DataLine += ";";
+                       DataLine += DateTimeStartDataTokens;
+                       
+               }
+
+               DataLine += ":";
+               DataLine += DateTimeStartData;
+               DataLine += "\n";
+               
+               DataLineProcessed = OutputText(&DataLine);
+               
+               *SaveData += DataLineProcessed;
+               
+               DataLine.clear();
+               DataLineProcessed.clear();
+               
+       }
+       
+       // Process the SUMMARY.
+       
+       if (SummaryData.size() > 0){
+               
+               DataLine += "SUMMARY";
+               
+               if (SummaryDataAltRep.size() > 0){
+               
+                       DataLine += ";ALTREP=";
+                       DataLine += SummaryDataAltRep;
+                       
+               }
+               
+               if (SummaryDataLanguage.size() > 0){
+               
+                       DataLine += ";TZID=";
+                       DataLine += SummaryDataLanguage;                        
+                       
+               }
+               
+               if (SummaryDataTokens.size() > 0){
+               
+                       DataLine += ";";
+                       DataLine += SummaryDataTokens;
+                       
+               }
+               
+               DataLine += ":";
+               DataLine += SummaryData;
+               DataLine += "\n";
+               
+               DataLineProcessed = OutputText(&DataLine);
+               
+               *SaveData += DataLineProcessed;
+
+               DataLine.clear();
+               DataLineProcessed.clear();
+               
+       }
+       
+       *SaveData += "END:VEVENT\n";
+       
+}
\ No newline at end of file
index e2bdf0d..c334b71 100644 (file)
@@ -10,6 +10,7 @@ class CalendarEventObject: public CalendarObject{
        private:
        
        void ProcessData();
+       void SaveObjectData(string *SaveData);
        
 };
 
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