--- /dev/null
+#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