Home | News | Projects | Releases
Bugs | RFE | Repositories | Help
Added DTEND property for saving data from a CalendarFreeBusyObject.
[xestiacalendar/.git] / source / objects / calendarfreebusy / CalendarFreeBusy-Save.cpp
1 #include "CalendarFreeBusy.h"
3 using namespace std;
5 void CalendarFreeBusyObject::SaveObjectData(string *SaveData){
7         string DataLine = "";
8         string DataLineProcessed = "";
9         
10         *SaveData += "BEGIN:VFREEBUSY\n";
11         
12         // Process the UID.
13         
14         if (UniqueID.size() > 0){
15                 
16                 if (UniqueIDTokens.size() > 0){
17                 
18                         DataLine += "UID;";
19                         DataLine += UniqueIDTokens;
20                         
21                 } else {
23                         DataLine += "UID";
24                         
25                 }
27                 DataLine += ":";
28                 DataLine += UniqueID;
29                 DataLine += "\n";
30                 
31                 DataLineProcessed = OutputText(&DataLine);
32                 
33                 *SaveData += DataLineProcessed;
34                 
35                 DataLine.clear();
36                 DataLineProcessed.clear();
37                 
38         }
39         
40         // Process the DTSTAMP.
41         
42         if (DateTimeStampData.size() > 0){
43                 
44                 if (DateTimeStampTokens.size() > 0){
45                 
46                         DataLine += "DTSTAMP;";
47                         DataLine += DateTimeStampTokens;
48                         
49                 } else {
51                         DataLine += "DTSTAMP";
52                         
53                 }
55                 DataLine += ":";
56                 DataLine += DateTimeStampData;
57                 DataLine += "\n";
58                 
59                 DataLineProcessed = OutputText(&DataLine);
60                 
61                 *SaveData += DataLineProcessed;
62                 
63                 DataLine.clear();
64                 DataLineProcessed.clear();
65                 
66         }
67         
68         // Process the CONTACT value.
69         
70         if (ContactList.size() > 0){
71                 
72                 if (ContactList[0].size() > 0){
73                 
74                         DataLine += "CONTACT";
75                 
76                         if (ContactListAltRep[0].size() > 0){
77                 
78                                 DataLine += ";ALTREP=\"";
79                                 DataLine += ContactListAltRep[0];
80                                 DataLine += "\"";
81                         
82                         }
83                 
84                         if (ContactListLanguage[0].size() > 0){
85                 
86                                 DataLine += ";LANGUAGE=";
87                                 DataLine += ContactListLanguage[0];
88                         
89                         }
90                 
91                         if (ContactListTokens[0].size() > 0){
92                 
93                                 DataLine += ";";
94                                 DataLine += ContactListTokens[0];
95                         
96                         }
97                 
98                         DataLine += ":";
99                         DataLine += ContactList[0];
100                         DataLine += "\n";
101                 
102                         DataLineProcessed = OutputText(&DataLine);
103                 
104                         *SaveData += DataLineProcessed;
106                         DataLine.clear();
107                         DataLineProcessed.clear();
108                 
109                 }
110                 
111         }
112         
113         // Process the DTSTART.
114         
115         if (DateTimeStartData.size() > 0){
116                 
117                 DataLine += "DTSTART";
118                 
119                 if (DateTimeStartDataValue.size() > 0){
120                 
121                         DataLine += ";VALUE=";
122                         DataLine += DateTimeStartDataValue;                     
123                         
124                 }
125                 
126                 if (DateTimeStartDataTimeZoneID.size() > 0){
127                 
128                         DataLine += ";TZID=";
129                         DataLine += DateTimeStartDataTimeZoneID;                        
130                         
131                 }
132                 
133                 if (DateTimeStartDataTokens.size() > 0){
134                 
135                         DataLine += ";";
136                         DataLine += DateTimeStartDataTokens;
137                         
138                 }
140                 DataLine += ":";
141                 DataLine += DateTimeStartData;
142                 DataLine += "\n";
143                 
144                 DataLineProcessed = OutputText(&DataLine);
145                 
146                 *SaveData += DataLineProcessed;
147                 
148                 DataLine.clear();
149                 DataLineProcessed.clear();
150                 
151         }
152         
153         // Process the DTEND.
154         
155         if (DateTimeEndData.size() > 0){
156                 
157                 DataLine += "DTEND";
158                 
159                 if (DateTimeEndDataValue.size() > 0){
160                 
161                         DataLine += ";VALUE=";
162                         DataLine += DateTimeEndDataValue;                       
163                         
164                 }
165                 
166                 if (DateTimeEndDataTimeZoneID.size() > 0){
167                 
168                         DataLine += ";TZID=";
169                         DataLine += DateTimeEndDataTimeZoneID;                  
170                         
171                 }
172                 
173                 if (DateTimeEndDataTokens.size() > 0){
174                 
175                         DataLine += ";";
176                         DataLine += DateTimeEndDataTokens;
177                         
178                 }
180                 DataLine += ":";
181                 DataLine += DateTimeEndData;
182                 DataLine += "\n";
183                 
184                 DataLineProcessed = OutputText(&DataLine);
185                 
186                 *SaveData += DataLineProcessed;
187                 
188                 DataLine.clear();
189                 DataLineProcessed.clear();
190                 
191         }
192         *SaveData += "END:VFREEBUSY\n";
193         
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