1 // ContactDataObject-Save.cpp - Client Data Object.
3 // (c) 2012-2016 Xestia Software Development.
5 // This file is part of Xestia Address Book.
7 // Xestia Address Book is free software: you can redistribute it and/or modify
8 // it under the terms of the GNU General Public License as published by the
9 // Free Software Foundation, version 3 of the license.
11 // Xestia Address Book is distributed in the hope that it will be useful,
12 // but WITHOUT ANY WARRANTY; without even the implied warranty of
13 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 // GNU General Public License for more details.
16 // You should have received a copy of the GNU General Public License along
17 // with Xestia Address Book. If not, see <http://www.gnu.org/licenses/>
19 #include "ContactDataObject.h"
20 #include "../../version.h"
22 ContactSaveStatus ContactDataObject::SaveString(wxString *SaveData){
24 ContactSaveStatus SaveDataStatus = CONTACTSAVE_UNITTESTFAIL;
26 // Write the header for the vCard data file.
28 SaveData->Append("BEGIN:VCARD\n");
29 SaveData->Append("VERSION:4.0\n");
31 // Write the product ID.
35 SaveData->Append("PRODID:-//Xestia//Address Book Unit Testing//KW\n");
39 SaveData->Append(wxT("PRODID:-//Xestia//Address Book Version "));
40 SaveData->Append(wxT(XSDAB_VERSION));
41 SaveData->Append(wxT("//KW\n"));
45 wxString ProcessData = "";
49 if (UIDToken.size() > 0){
51 ProcessData.Append("UID:");
52 ProcessData.Append(UIDToken);
53 ProcessData.Append("\n");
54 SaveData->Append(ProcessData);
63 case CONTACTKIND_NONE:
65 case CONTACTKIND_INDIVIDUAL:
66 SaveData->Append("KIND:individual\n");
68 case CONTACTKIND_GROUP:
69 SaveData->Append("KIND:group\n");
71 case CONTACTKIND_ORGANISATION:
72 SaveData->Append("KIND:org\n");
74 case CONTACTKIND_LOCATION:
75 SaveData->Append("KIND:location\n");
86 for (std::map<int, wxString>::iterator XMLIter = XMLList.begin();
87 XMLIter != XMLList.end(); XMLIter++){
89 ProcessData.Append("XML");
91 if (XMLListAltID[XMLIter->first].size() > 0){
93 ProcessData.Append(";ALTID=");
94 ProcessData.Append(XMLListAltID[XMLIter->first]);
98 ProcessData.Append(":");
99 ProcessData.Append(XMLIter->second);
100 ProcessData.Append("\n");
102 ProcessData = OutputText(&ProcessData);
104 SaveData->Append(ProcessData);
111 SaveSource(&SourceList, &SourceListAltID,
112 &SourceListPID, &SourceListType,
113 &SourceListMediatype, &SourceListPref,
114 &SourceListTokens, SaveData);
116 // Process MEMBER (if contact kind is CONTACTKIND_GROUP).
118 if (ContactKind == CONTACTKIND_GROUP){
120 SaveMember(&GroupsList, &GroupsListAltID,
121 &GroupsListPID, &GroupsListType,
122 &GroupsListMediaType, &GroupsListPref,
123 &GroupsListTokens, SaveData);
127 // Process CLIENTPIDMAP.
129 for (std::map<int, wxString>::iterator CPIDIter = ClientPIDList.begin();
130 CPIDIter != ClientPIDList.end(); CPIDIter++){
132 ProcessData.Append("CLIENTPIDMAP");
134 if (ClientPIDListTokens[CPIDIter->first].size() > 0){
136 ProcessData.Append(";");
137 ProcessData.Append(ClientPIDListTokens[CPIDIter->first]);
141 ProcessData.Append(":");
142 ProcessData.Append(CPIDIter->second);
143 ProcessData.Append("\n");
145 ProcessData = OutputText(&ProcessData);
147 SaveData->Append(ProcessData);
154 for (std::map<int, wxString>::iterator FNIter = FullNamesList.begin();
155 FNIter != FullNamesList.end(); FNIter++){
157 ProcessData.Append("FN");
159 // Check if there is a value for TYPE.
161 if (FullNamesListType[FNIter->first].size() > 0){
163 ProcessData.Append(";TYPE=");
164 ProcessData.Append(FullNamesListType[FNIter->first]);
168 // Check if there is a value for LANGUAGE.
170 if (FullNamesListLanguage[FNIter->first].size() > 0){
172 ProcessData.Append(";LANGUAGE=");
173 ProcessData.Append(FullNamesListLanguage[FNIter->first]);
177 // Check if there is a value for ALTID.
179 if (FullNamesListAltID[FNIter->first].size() > 0){
181 ProcessData.Append(";ALTID=");
182 ProcessData.Append(FullNamesListAltID[FNIter->first]);
186 // Check if there is a value for PID.
188 if (FullNamesListPID[FNIter->first].size() > 0){
190 ProcessData.Append(";PID=");
191 ProcessData.Append(FullNamesListPID[FNIter->first]);
195 // Check if there is a value for PREF.
197 if (FullNamesListPref[FNIter->first] > 0){
199 ProcessData.Append(";PREF=");
200 ProcessData.Append(wxString::Format("%i", FullNamesListPref[FNIter->first]));
204 // Check if there is a value for tokens.
206 if (FullNamesListTokens[FNIter->first].size() > 0){
208 ProcessData.Append(";");
209 ProcessData.Append(FullNamesListTokens[FNIter->first]);
213 ProcessData.Append(":");
214 ProcessData.Append(FNIter->second);
215 ProcessData.Append("\n");
217 ProcessData = OutputText(&ProcessData);
219 SaveData->Append(ProcessData);
226 SaveNickname(&GeneralNicknamesList, &GeneralNicknamesListAltID,
227 &GeneralNicknamesListPID, &GeneralNicknamesListType,
228 &GeneralNicknamesListLanguage, &GeneralNicknamesListPref,
229 &GeneralNicknamesListTokens, SaveData, "");
230 SaveNickname(&HomeNicknamesList, &HomeNicknamesListAltID,
231 &HomeNicknamesListPID, &HomeNicknamesListType,
232 &HomeNicknamesListLanguage, &HomeNicknamesListPref,
233 &HomeNicknamesListTokens, SaveData, "home");
234 SaveNickname(&BusinessNicknamesList, &BusinessNicknamesListAltID,
235 &BusinessNicknamesListPID, &BusinessNicknamesListType,
236 &BusinessNicknamesListLanguage, &BusinessNicknamesListPref,
237 &BusinessNicknamesListTokens, SaveData, "work");
241 SaveTitle(&GeneralTitleList, &GeneralTitleListLanguage,
242 &GeneralTitleListAltID, &GeneralTitleListPID,
243 &GeneralTitleListType, &GeneralTitleListPref,
244 &GeneralTitleListTokens, SaveData, "");
245 SaveTitle(&HomeTitleList, &HomeTitleListLanguage,
246 &HomeTitleListAltID, &HomeTitleListPID,
247 &HomeTitleListType, &HomeTitleListPref,
248 &HomeTitleListTokens, SaveData, "home");
249 SaveTitle(&BusinessTitleList, &BusinessTitleListLanguage,
250 &BusinessTitleListAltID, &BusinessTitleListPID,
251 &BusinessTitleListType, &BusinessTitleListPref,
252 &BusinessTitleListTokens, SaveData, "work");
256 SaveTimezone(&GeneralTZList, &GeneralTZListAltID,
257 &GeneralTZListPID, &GeneralTZListType,
258 &GeneralTZListMediatype, &GeneralTZListPref,
259 &GeneralTZListTokens, SaveData, "");
260 SaveTimezone(&HomeTZList, &HomeTZListAltID,
261 &HomeTZListPID, &HomeTZListType,
262 &HomeTZListMediatype, &HomeTZListPref,
263 &HomeTZListTokens, SaveData, "home");
264 SaveTimezone(&BusinessTZList, &BusinessTZListAltID,
265 &BusinessTZListPID, &BusinessTZListType,
266 &BusinessTZListMediatype, &BusinessTZListPref,
267 &BusinessTZListTokens, SaveData, "work");
271 SaveAddress(&GeneralAddressList, &GeneralAddressListTown,
272 &GeneralAddressListCounty, &GeneralAddressListPostCode,
273 &GeneralAddressListCountry, &GeneralAddressListLabel,
274 &GeneralAddressListLang, &GeneralAddressListAltID,
275 &GeneralAddressListPID, &GeneralAddressListGeo,
276 &GeneralAddressListTimezone, &GeneralAddressListType,
277 &GeneralAddressListMediatype, &GeneralAddressListPref,
278 &GeneralAddressListTokens, SaveData, "");
279 SaveAddress(&HomeAddressList, &HomeAddressListTown,
280 &HomeAddressListCounty, &HomeAddressListPostCode,
281 &HomeAddressListCountry, &HomeAddressListLabel,
282 &HomeAddressListLang, &HomeAddressListAltID,
283 &HomeAddressListPID, &HomeAddressListGeo,
284 &HomeAddressListTimezone, &HomeAddressListType,
285 &HomeAddressListMediatype, &HomeAddressListPref,
286 &HomeAddressListTokens, SaveData, "home");
287 SaveAddress(&BusinessAddressList, &BusinessAddressListTown,
288 &BusinessAddressListCounty, &BusinessAddressListPostCode,
289 &BusinessAddressListCountry, &BusinessAddressListLabel,
290 &BusinessAddressListLang, &BusinessAddressListAltID,
291 &BusinessAddressListPID, &BusinessAddressListGeo,
292 &BusinessAddressListTimezone, &BusinessAddressListType,
293 &BusinessAddressListMediatype, &BusinessAddressListPref,
294 &BusinessAddressListTokens, SaveData, "work");
298 SaveEmail(&GeneralEmailList, &GeneralEmailListAltID,
299 &GeneralEmailListPID, &GeneralEmailListType,
300 &GeneralEmailListPref, &GeneralEmailListTokens,
302 SaveEmail(&HomeEmailList, &HomeEmailListAltID,
303 &HomeEmailListPID, &HomeEmailListType,
304 &HomeEmailListPref, &HomeEmailListTokens,
306 SaveEmail(&BusinessEmailList, &BusinessEmailListAltID,
307 &BusinessEmailListPID, &BusinessEmailListType,
308 &BusinessEmailListPref, &BusinessEmailListTokens,
311 // TODO: Process IMPP.
313 // TODO: Process TEL.
317 SaveLanguage(&GeneralLanguageList, &GeneralLanguageListAltID,
318 &GeneralLanguageListPID, &GeneralLanguageListType,
319 &GeneralLanguageListPref, &GeneralLanguageListTokens,
321 SaveLanguage(&HomeLanguageList, &HomeLanguageListAltID,
322 &HomeLanguageListPID, &HomeLanguageListType,
323 &HomeLanguageListPref, &HomeLanguageListTokens,
325 SaveLanguage(&BusinessLanguageList, &BusinessLanguageListAltID,
326 &BusinessLanguageListPID, &BusinessLanguageListType,
327 &BusinessLanguageListPref, &BusinessLanguageListTokens,
332 SaveGeoposition(&GeneralGeographyList, &GeneralGeographyListAltID,
333 &GeneralGeographyListPID, &GeneralGeographyListType,
334 &GeneralGeographyListMediatype, &GeneralGeographyListDataType,
335 &GeneralGeographyListPref, &GeneralGeographyListTokens,
337 SaveGeoposition(&HomeGeographyList, &HomeGeographyListAltID,
338 &HomeGeographyListPID, &HomeGeographyListType,
339 &HomeGeographyListMediatype, &HomeGeographyListDataType,
340 &HomeGeographyListPref, &HomeGeographyListTokens,
342 SaveGeoposition(&BusinessGeographyList, &BusinessGeographyListAltID,
343 &BusinessGeographyListPID, &BusinessGeographyListType,
344 &BusinessGeographyListMediatype, &BusinessGeographyListDataType,
345 &BusinessGeographyListPref, &BusinessGeographyListTokens,
352 for (std::map<int, wxString>::iterator RelatedIter = GeneralRelatedList.begin();
353 RelatedIter != GeneralRelatedList.end(); RelatedIter++){
355 ProcessData.Append("RELATED");
357 // Check if there is a value for TYPE.
359 if (GeneralRelatedListRelType[RelatedIter->first].size() > 0){
361 wxString RelatedType = "";
363 ProcessData.Append(";TYPE=");
365 if (GeneralRelatedListRelType[RelatedIter->first] == _("Contact")){
367 RelatedType = wxT("contact");
369 } else if (GeneralRelatedListRelType[RelatedIter->first] == _("Acquaintance")){
371 RelatedType = wxT("acquaintance");
373 } else if (GeneralRelatedListRelType[RelatedIter->first] == _("Friend")){
375 RelatedType = wxT("friend");
377 } else if (GeneralRelatedListRelType[RelatedIter->first] == _("Met")){
379 RelatedType = wxT("met");
381 } else if (GeneralRelatedListRelType[RelatedIter->first] == _("Co-worker")){
383 RelatedType = wxT("co-worker");
385 } else if (GeneralRelatedListRelType[RelatedIter->first] == _("Colleague")){
387 RelatedType = wxT("colleague");
389 } else if (GeneralRelatedListRelType[RelatedIter->first] == _("Co-resident")){
391 RelatedType = wxT("co-resident");
393 } else if (GeneralRelatedListRelType[RelatedIter->first] == _("Neighbour")){
395 RelatedType = wxT("neighbor");
397 } else if (GeneralRelatedListRelType[RelatedIter->first] == _("Child")){
399 RelatedType = wxT("child");
401 } else if (GeneralRelatedListRelType[RelatedIter->first] == _("Parent")){
403 RelatedType = wxT("parent");
405 } else if (GeneralRelatedListRelType[RelatedIter->first] == _("Sibling")){
407 RelatedType = wxT("sibling");
409 } else if (GeneralRelatedListRelType[RelatedIter->first] == _("Spouse")){
411 RelatedType = wxT("spouse");
413 } else if (GeneralRelatedListRelType[RelatedIter->first] == _("Kin")){
415 RelatedType = wxT("kin");
417 } else if (GeneralRelatedListRelType[RelatedIter->first] == _("Muse")){
419 RelatedType = wxT("muse");
421 } else if (GeneralRelatedListRelType[RelatedIter->first] == _("Crush")){
423 RelatedType = wxT("crush");
425 } else if (GeneralRelatedListRelType[RelatedIter->first] == _("Date")){
427 RelatedType = wxT("date");
429 } else if (GeneralRelatedListRelType[RelatedIter->first]== _("Sweetheart")){
431 RelatedType = wxT("sweetheart");
433 } else if (GeneralRelatedListRelType[RelatedIter->first] == _("Me")){
435 RelatedType = wxT("me");
437 } else if (GeneralRelatedListRelType[RelatedIter->first] == _("Agent")){
439 RelatedType = wxT("agent");
441 } else if (GeneralRelatedListRelType[RelatedIter->first] == _("Emergency")){
443 RelatedType = wxT("emergency");
447 RelatedType = GeneralRelatedListRelType[RelatedIter->first];
451 ProcessData.Append(RelatedType);
455 // Check if there is a value for LANGUAGE.
457 if (GeneralRelatedListLanguage[RelatedIter->first].size() > 0){
459 ProcessData.Append(";LANGUAGE=");
460 ProcessData.Append(GeneralRelatedListLanguage[RelatedIter->first]);
464 // Check if there is a value for ALTID.
466 if (GeneralRelatedListAltID[RelatedIter->first].size() > 0){
468 ProcessData.Append(";ALTID=");
469 ProcessData.Append(GeneralRelatedListAltID[RelatedIter->first]);
473 // Check if there is a value for PID.
475 if (GeneralRelatedListPID[RelatedIter->first].size() > 0){
477 ProcessData.Append(";PID=");
478 ProcessData.Append(GeneralRelatedListPID[RelatedIter->first]);
482 // Check if there is a value for PREF.
484 if (GeneralRelatedListPref[RelatedIter->first] > 0){
486 ProcessData.Append(";PREF=");
487 ProcessData.Append(wxString::Format("%i", GeneralRelatedListPref[RelatedIter->first]));
491 // Check if there is a value for tokens.
493 if (GeneralRelatedListTokens[RelatedIter->first].size() > 0){
495 ProcessData.Append(";");
496 ProcessData.Append(GeneralRelatedListTokens[RelatedIter->first]);
500 ProcessData.Append(":");
501 ProcessData.Append(RelatedIter->second);
502 ProcessData.Append("\n");
504 ProcessData = OutputText(&ProcessData);
506 SaveData->Append(ProcessData);
513 SaveURL(&GeneralWebsiteList, &GeneralWebsiteListAltID,
514 &GeneralWebsiteListPID, &GeneralWebsiteListType,
515 &GeneralWebsiteListMediatype, &GeneralWebsiteListPref,
516 &GeneralWebsiteListTokens, SaveData, "");
517 SaveURL(&HomeWebsiteList, &HomeWebsiteListAltID,
518 &HomeWebsiteListPID, &HomeWebsiteListType,
519 &HomeWebsiteListMediatype, &HomeWebsiteListPref,
520 &HomeWebsiteListTokens, SaveData, "home");
521 SaveURL(&BusinessWebsiteList, &BusinessWebsiteListAltID,
522 &BusinessWebsiteListPID, &BusinessWebsiteListType,
523 &BusinessWebsiteListMediatype, &BusinessWebsiteListPref,
524 &BusinessWebsiteListTokens, SaveData, "work");
528 SaveRole(&GeneralRoleList, &GeneralRoleListLanguage,
529 &GeneralRoleListAltID, &GeneralRoleListPID,
530 &GeneralRoleListType, &GeneralRoleListPref,
531 &GeneralRoleListTokens, SaveData, "");
532 SaveRole(&HomeRoleList, &HomeRoleListLanguage,
533 &HomeRoleListAltID, &HomeRoleListPID,
534 &HomeRoleListType, &HomeRoleListPref,
535 &HomeRoleListTokens, SaveData, "home");
536 SaveRole(&BusinessRoleList, &BusinessRoleListLanguage,
537 &BusinessRoleListAltID, &BusinessRoleListPID,
538 &BusinessRoleListType, &BusinessRoleListPref,
539 &BusinessRoleListTokens, SaveData, "work");
543 SaveOrganisation(&GeneralOrganisationsList, &GeneralOrganisationsListAltID,
544 &GeneralOrganisationsListPID, &GeneralOrganisationsListLanguage,
545 &GeneralOrganisationsListSortAs, &GeneralOrganisationsListType,
546 &GeneralOrganisationsListPref, &GeneralOrganisationsListTokens,
548 SaveOrganisation(&HomeOrganisationsList, &HomeOrganisationsListAltID,
549 &HomeOrganisationsListPID, &HomeOrganisationsListLanguage,
550 &HomeOrganisationsListSortAs, &HomeOrganisationsListType,
551 &HomeOrganisationsListPref, &HomeOrganisationsListTokens,
553 SaveOrganisation(&BusinessOrganisationsList, &BusinessOrganisationsListAltID,
554 &BusinessOrganisationsListPID, &BusinessOrganisationsListLanguage,
555 &BusinessOrganisationsListSortAs, &BusinessOrganisationsListType,
556 &BusinessOrganisationsListPref, &BusinessOrganisationsListTokens,
561 SaveNote(&GeneralNoteList, &GeneralNoteListLanguage,
562 &GeneralNoteListAltID, &GeneralNoteListPID,
563 &GeneralNoteListType, &GeneralNoteListPref,
564 &GeneralNoteListTokens, SaveData, "");
565 SaveNote(&HomeNoteList, &HomeNoteListLanguage,
566 &HomeNoteListAltID, &HomeNoteListPID,
567 &HomeNoteListType, &HomeNoteListPref,
568 &HomeNoteListTokens, SaveData, "home");
569 SaveNote(&BusinessNoteList, &BusinessNoteListLanguage,
570 &BusinessNoteListAltID, &BusinessNoteListPID,
571 &BusinessNoteListType, &BusinessNoteListPref,
572 &BusinessNoteListTokens, SaveData, "work");
574 // Process CATEGORIES.
576 SaveCategory(&CategoriesList, &CategoriesListLanguage,
577 &CategoriesListAltID, &CategoriesListPID,
578 &CategoriesListType, &CategoriesListPref,
579 &CategoriesListTokens, SaveData);
583 SavePhoto(&PicturesList, &PicturesListAltID,
584 &PicturesListPID, &PicturesListType,
585 &PicturesListPicEncType, &PicturesListPictureType,
586 &PicturesListMediatype, &PicturesListPref,
587 &PicturesListTokens, SaveData);
591 SaveLogo(&LogosList, &LogosListAltID,
592 &LogosListPID, &LogosListType,
593 &LogosListPicEncType, &LogosListPictureType,
594 &LogosListMediatype, &LogosListPref,
595 &LogosListTokens, SaveData);
599 SaveSound(&SoundsList, &SoundsListAltID,
600 &SoundsListPID, &SoundsListType,
601 &SoundsListAudioEncType, &SoundsListAudioType,
602 &SoundsListMediatype, &SoundsListLanguage,
603 &SoundsListPref, &SoundsListTokens,
608 SaveCalendarURI(&CalendarList, &CalendarListMediatype,
609 &CalendarListAltID, &CalendarListPID,
610 &CalendarListType, &CalendarListPref,
611 &CalendarListTokens, SaveData);
613 // Process CALADRURI.
615 SaveCalendarRequestURI(&CalendarRequestList, &CalendarRequestListMediatype,
616 &CalendarRequestListAltID, &CalendarRequestListPID,
617 &CalendarRequestListType, &CalendarRequestListPref,
618 &CalendarRequestListTokens, SaveData);
622 SaveFreeBusyURI(&FreeBusyList, &FreeBusyListAltID,
623 &FreeBusyListPID, &FreeBusyListType,
624 &FreeBusyListMediatype, &FreeBusyListPref,
625 &FreeBusyListTokens, SaveData);
629 SaveKey(&KeyList, &KeyListAltID,
630 &KeyListPID, &KeyListType,
631 &KeyListKeyType, &KeyListDataEncType,
632 &KeyListDataType, &KeyListPref,
633 &KeyListTokens, SaveData);
637 SaveVendor(&VendorList, &VendorListPEN,
638 &VendorListElement, SaveData);
642 SaveXToken(&XTokenList, &XTokenListTokens,
645 // Write the end part of the vCard data file.
647 SaveData->Append("END:VCARD");
649 SaveDataStatus = CONTACTSAVE_OK;
651 return SaveDataStatus;
655 void ContactDataObject::SaveTitle(map<int, wxString> *TitleList, map<int, wxString> *TitleListLanguage,
656 map<int, wxString> *TitleListAltID, map<int, wxString> *TitleListPID,
657 map<int, wxString> *TitleListType, map<int, int> *TitleListPref,
658 map<int, wxString> *TitleListTokens, wxString *SaveData, wxString DataType){
660 wxString ProcessData = "";
662 for (std::map<int, wxString>::iterator TitleIter = TitleList->begin();
663 TitleIter != TitleList->end(); TitleIter++){
665 ProcessData.Append("TITLE");
667 // Check if there is a value for TYPE.
669 if (DataType.size() > 0){
671 ProcessData.Append(";TYPE=");
672 ProcessData.Append(DataType);
676 // Check if there is a value for ALTID.
678 if ((*TitleListAltID)[TitleIter->first].size() > 0){
680 ProcessData.Append(";ALTID=");
681 ProcessData.Append((*TitleListAltID)[TitleIter->first]);
685 // Check if there is a value for LANGUAGE.
687 if ((*TitleListLanguage)[TitleIter->first].size() > 0){
689 ProcessData.Append(";LANGUAGE=");
690 ProcessData.Append((*TitleListLanguage)[TitleIter->first]);
694 // Check if there is a value for PID.
696 if ((*TitleListPID)[TitleIter->first].size() > 0){
698 ProcessData.Append(";PID=");
699 ProcessData.Append((*TitleListPID)[TitleIter->first]);
703 // Check if there is a value for PREF.
705 if ((*TitleListPref)[TitleIter->first] > 0){
707 ProcessData.Append(";PREF=");
708 ProcessData.Append(wxString::Format("%i", (*TitleListPref)[TitleIter->first]));
712 // Check if there is a value for tokens.
714 if ((*TitleListTokens)[TitleIter->first].size() > 0){
716 ProcessData.Append(";");
717 ProcessData.Append((*TitleListTokens)[TitleIter->first]);
721 ProcessData.Append(":");
722 ProcessData.Append(TitleIter->second);
723 ProcessData.Append("\n");
725 ProcessData = OutputText(&ProcessData);
727 SaveData->Append(ProcessData);
734 void ContactDataObject::SaveSource(map<int, wxString> *SourceList, map<int, wxString> *SourceListAltID,
735 map<int, wxString> *SourceListPID, map<int, wxString> *SourceListType,
736 map<int, wxString> *SourceListMediatype, map<int, int> *SourceListPref,
737 map<int, wxString> *SourceListTokens, wxString *SaveData){
739 wxString ProcessData = "";
741 for (std::map<int, wxString>::iterator SourceIter = SourceList->begin();
742 SourceIter != SourceList->end(); SourceIter++){
744 ProcessData.Append("SOURCE");
746 // Check if there is a value for TYPE.
748 if ((*SourceListType)[SourceIter->first].size() > 0){
750 ProcessData.Append(";TYPE=");
751 ProcessData.Append((*SourceListType)[SourceIter->first]);
755 // Check if there is a value for ALTID.
757 if ((*SourceListAltID)[SourceIter->first].size() > 0){
759 ProcessData.Append(";ALTID=");
760 ProcessData.Append((*SourceListAltID)[SourceIter->first]);
764 // Check if there is a value for MEDIATYPE.
766 if ((*SourceListMediatype)[SourceIter->first].size() > 0){
768 ProcessData.Append(";MEDIATYPE=");
769 ProcessData.Append((*SourceListMediatype)[SourceIter->first]);
773 // Check if there is a value for PID.
775 if ((*SourceListPID)[SourceIter->first].size() > 0){
777 ProcessData.Append(";PID=");
778 ProcessData.Append((*SourceListPID)[SourceIter->first]);
782 // Check if there is a value for PREF.
784 if ((*SourceListPref)[SourceIter->first] > 0){
786 ProcessData.Append(";PREF=");
787 ProcessData.Append(wxString::Format("%i", (*SourceListPref)[SourceIter->first]));
791 // Check if there is a value for tokens.
793 if ((*SourceListTokens)[SourceIter->first].size() > 0){
795 ProcessData.Append(";");
796 ProcessData.Append((*SourceListTokens)[SourceIter->first]);
800 ProcessData.Append(":");
801 ProcessData.Append(SourceIter->second);
802 ProcessData.Append("\n");
804 ProcessData = OutputText(&ProcessData);
806 SaveData->Append(ProcessData);
813 void ContactDataObject::SaveMember(std::map<int, wxString> *GroupsList, std::map<int, wxString> *GroupsListAltID,
814 std::map<int, wxString> *GroupsListPID, std::map<int, wxString> *GroupsListType,
815 std::map<int, wxString> *GroupsListMediaType, std::map<int, int> *GroupsListPref,
816 std::map<int, wxString> *GroupsListTokens, wxString *SaveData){
818 wxString ProcessData = "";
820 for (std::map<int, wxString>::iterator GroupsIter = GroupsList->begin();
821 GroupsIter != GroupsList->end(); GroupsIter++){
823 ProcessData.Append("MEMBER");
825 // Check if there is a value for TYPE.
827 if ((*GroupsListType)[GroupsIter->first].size() > 0){
829 ProcessData.Append(";TYPE=");
830 ProcessData.Append((*GroupsListType)[GroupsIter->first]);
834 // Check if there is a value for ALTID.
836 if ((*GroupsListAltID)[GroupsIter->first].size() > 0){
838 ProcessData.Append(";ALTID=");
839 ProcessData.Append((*GroupsListAltID)[GroupsIter->first]);
843 // Check if there is a value for MEDIATYPE.
845 if ((*GroupsListMediaType)[GroupsIter->first].size() > 0){
847 ProcessData.Append(";MEDIATYPE=");
848 ProcessData.Append((*GroupsListMediaType)[GroupsIter->first]);
852 // Check if there is a value for PID.
854 if ((*GroupsListPID)[GroupsIter->first].size() > 0){
856 ProcessData.Append(";PID=");
857 ProcessData.Append((*GroupsListPID)[GroupsIter->first]);
861 // Check if there is a value for PREF.
863 if ((*GroupsListPref)[GroupsIter->first] > 0){
865 ProcessData.Append(";PREF=");
866 ProcessData.Append(wxString::Format("%i", (*GroupsListPref)[GroupsIter->first]));
870 // Check if there is a value for tokens.
872 if ((*GroupsListTokens)[GroupsIter->first].size() > 0){
874 ProcessData.Append(";");
875 ProcessData.Append((*GroupsListTokens)[GroupsIter->first]);
879 ProcessData.Append(":");
880 ProcessData.Append(GroupsIter->second);
881 ProcessData.Append("\n");
883 ProcessData = OutputText(&ProcessData);
885 SaveData->Append(ProcessData);
892 void ContactDataObject::SaveNickname(map<int, wxString> *NicknameList, map<int, wxString> *NicknameListAltID,
893 map<int, wxString> *NicknameListPID, map<int, wxString> *NicknameListType,
894 map<int, wxString> *NicknameListLanguage, map<int, int> *NicknameListPref,
895 map<int, wxString> *NicknameListTokens, wxString *SaveData, wxString DataType){
897 wxString ProcessData = "";
899 for (std::map<int, wxString>::iterator NicknameIter = NicknameList->begin();
900 NicknameIter != NicknameList->end(); NicknameIter++){
902 ProcessData.Append("NICKNAME");
904 // Check if there is a value for TYPE.
906 if (DataType.size() > 0){
908 ProcessData.Append(";TYPE=");
909 ProcessData.Append(DataType);
913 // Check if there is a value for ALTID.
915 if ((*NicknameListAltID)[NicknameIter->first].size() > 0){
917 ProcessData.Append(";ALTID=");
918 ProcessData.Append((*NicknameListAltID)[NicknameIter->first]);
922 // Check if there is a value for MEDIATYPE.
924 if ((*NicknameListLanguage)[NicknameIter->first].size() > 0){
926 ProcessData.Append(";LANGUAGE=");
927 ProcessData.Append((*NicknameListLanguage)[NicknameIter->first]);
931 // Check if there is a value for PID.
933 if ((*NicknameListPID)[NicknameIter->first].size() > 0){
935 ProcessData.Append(";PID=");
936 ProcessData.Append((*NicknameListPID)[NicknameIter->first]);
940 // Check if there is a value for PREF.
942 if ((*NicknameListPref)[NicknameIter->first] > 0){
944 ProcessData.Append(";PREF=");
945 ProcessData.Append(wxString::Format("%i", (*NicknameListPref)[NicknameIter->first]));
949 // Check if there is a value for tokens.
951 if ((*NicknameListTokens)[NicknameIter->first].size() > 0){
953 ProcessData.Append(";");
954 ProcessData.Append((*NicknameListTokens)[NicknameIter->first]);
958 ProcessData.Append(":");
959 ProcessData.Append(NicknameIter->second);
960 ProcessData.Append("\n");
962 ProcessData = OutputText(&ProcessData);
964 SaveData->Append(ProcessData);
971 void ContactDataObject::SaveTimezone(map<int, wxString> *TZList, map<int, wxString> *TZListAltID,
972 map<int, wxString> *TZListPID, map<int, wxString> *TZListType,
973 map<int, wxString> *TZListMediatype, map<int, int> *TZListPref,
974 map<int, wxString> *TZListTokens, wxString *SaveData, wxString DataType){
976 wxString ProcessData = "";
978 for (std::map<int, wxString>::iterator TZIter = TZList->begin();
979 TZIter != TZList->end(); TZIter++){
981 ProcessData.Append("TZ");
983 // Check if there is a value for TYPE.
985 if (DataType.size() > 0){
987 ProcessData.Append(";TYPE=");
988 ProcessData.Append(DataType);
992 // Check if there is a value for ALTID.
994 if ((*TZListAltID)[TZIter->first].size() > 0){
996 ProcessData.Append(";ALTID=");
997 ProcessData.Append((*TZListAltID)[TZIter->first]);
1001 // Check if there is a value for MEDIATYPE.
1003 if ((*TZListMediatype)[TZIter->first].size() > 0){
1005 ProcessData.Append(";MEDIATYPE=");
1006 ProcessData.Append((*TZListMediatype)[TZIter->first]);
1010 // Check if there is a value for PID.
1012 if ((*TZListPID)[TZIter->first].size() > 0){
1014 ProcessData.Append(";PID=");
1015 ProcessData.Append((*TZListPID)[TZIter->first]);
1019 // Check if there is a value for PREF.
1021 if ((*TZListPref)[TZIter->first] > 0){
1023 ProcessData.Append(";PREF=");
1024 ProcessData.Append(wxString::Format("%i", (*TZListPref)[TZIter->first]));
1028 // Check if there is a value for tokens.
1030 if ((*TZListTokens)[TZIter->first].size() > 0){
1032 ProcessData.Append(";");
1033 ProcessData.Append((*TZListTokens)[TZIter->first]);
1037 ProcessData.Append(":");
1038 ProcessData.Append(TZIter->second);
1039 ProcessData.Append("\n");
1041 ProcessData = OutputText(&ProcessData);
1043 SaveData->Append(ProcessData);
1044 ProcessData.clear();
1050 void ContactDataObject::SaveAddress(map<int, wxString> *AddressList, map<int, wxString> *AddressListTown,
1051 map<int, wxString> *AddressListCounty, map<int, wxString> *AddressListPostCode,
1052 map<int, wxString> *AddressListCountry, map<int, wxString> *AddressListLabel,
1053 map<int, wxString> *AddressListLang, map<int, wxString> *AddressListAltID,
1054 map<int, wxString> *AddressListPID, map<int, wxString> *AddressListGeo,
1055 map<int, wxString> *AddressListTimezone, map<int, wxString> *AddressListType,
1056 map<int, wxString> *AddressListMediatype, map<int, int> *AddressListPref,
1057 map<int, wxString> *AddressListTokens, wxString *SaveData, wxString DataType){
1059 wxString ProcessData = "";
1061 for (std::map<int, wxString>::iterator AddressIter = AddressList->begin();
1062 AddressIter != AddressList->end(); AddressIter++){
1064 ProcessData.Append("ADR");
1066 // Check if there is a value for TYPE.
1068 if (DataType.size() > 0){
1070 ProcessData.Append(";TYPE=");
1071 ProcessData.Append(DataType);
1075 // Check if there is a value for ALTID.
1077 if ((*AddressListAltID)[AddressIter->first].size() > 0){
1079 ProcessData.Append(";ALTID=");
1080 ProcessData.Append((*AddressListAltID)[AddressIter->first]);
1084 // Check if there is a value for GEO.
1086 if ((*AddressListGeo)[AddressIter->first].size() > 0){
1088 ProcessData.Append(";GEO=\"");
1089 ProcessData.Append((*AddressListGeo)[AddressIter->first]);
1090 ProcessData.Append("\"");
1094 // Check if there is a value for LABEL.
1096 if ((*AddressListLabel)[AddressIter->first].size() > 0){
1098 wxString AddressProcessed = "";
1099 AddressProcessed = (*AddressListLabel)[AddressIter->first];
1101 AddressProcessed.Replace("\n", "\\n", true);
1103 ProcessData.Append(";LABEL=");
1104 ProcessData.Append(AddressProcessed);
1108 // Check if there is a value for LANGUAGE.
1110 if ((*AddressListLang)[AddressIter->first].size() > 0){
1112 ProcessData.Append(";LANGUAGE=");
1113 ProcessData.Append((*AddressListLang)[AddressIter->first]);
1117 // Check if there is a value for MEDIATYPE.
1119 if ((*AddressListMediatype)[AddressIter->first].size() > 0){
1121 ProcessData.Append(";MEDIATYPE=");
1122 ProcessData.Append((*AddressListMediatype)[AddressIter->first]);
1126 // Check if there is a value for PID.
1128 if ((*AddressListPID)[AddressIter->first].size() > 0){
1130 ProcessData.Append(";PID=");
1131 ProcessData.Append((*AddressListPID)[AddressIter->first]);
1135 // Check if there is a value for PREF.
1137 if ((*AddressListPref)[AddressIter->first] > 0){
1139 ProcessData.Append(";PREF=");
1140 ProcessData.Append(wxString::Format("%i", (*AddressListPref)[AddressIter->first]));
1144 // Check if there is a value for TZ.
1146 if ((*AddressListTimezone)[AddressIter->first].size() > 0){
1148 ProcessData.Append(";TZ=");
1149 ProcessData.Append((*AddressListTimezone)[AddressIter->first]);
1153 // Check if there is a value for tokens.
1155 if ((*AddressListTokens)[AddressIter->first].size() > 0){
1157 ProcessData.Append(";");
1158 ProcessData.Append((*AddressListTokens)[AddressIter->first]);
1162 // Build the address.
1164 ProcessData.Append(":;;");
1165 ProcessData.Append((*AddressList)[AddressIter->first]);
1166 ProcessData.Append(";");
1167 ProcessData.Append((*AddressListTown)[AddressIter->first]);
1168 ProcessData.Append(";");
1169 ProcessData.Append((*AddressListCounty)[AddressIter->first]);
1170 ProcessData.Append(";");
1171 ProcessData.Append((*AddressListPostCode)[AddressIter->first]);
1172 ProcessData.Append(";");
1173 ProcessData.Append((*AddressListCountry)[AddressIter->first]);
1174 ProcessData.Append("\n");
1176 ProcessData = OutputText(&ProcessData);
1178 SaveData->Append(ProcessData);
1179 ProcessData.clear();
1185 void ContactDataObject::SaveEmail(map<int, wxString> *EmailList, map<int, wxString> *EmailListAltID,
1186 map<int, wxString> *EmailListPID, map<int, wxString> *EmailListType,
1187 map<int, int> *EmailListPref, map<int, wxString> *EmailListTokens,
1188 wxString *SaveData, wxString DataType){
1190 wxString ProcessData = "";
1192 for (std::map<int, wxString>::iterator EmailIter = EmailList->begin();
1193 EmailIter != EmailList->end(); EmailIter++){
1195 ProcessData.Append("EMAIL");
1197 // Check if there is a value for TYPE.
1199 if (DataType.size() > 0){
1201 ProcessData.Append(";TYPE=");
1202 ProcessData.Append(DataType);
1206 // Check if there is a value for ALTID.
1208 if ((*EmailListAltID)[EmailIter->first].size() > 0){
1210 ProcessData.Append(";ALTID=");
1211 ProcessData.Append((*EmailListAltID)[EmailIter->first]);
1215 // Check if there is a value for PID.
1217 if ((*EmailListPID)[EmailIter->first].size() > 0){
1219 ProcessData.Append(";PID=");
1220 ProcessData.Append((*EmailListPID)[EmailIter->first]);
1224 // Check if there is a value for PREF.
1226 if ((*EmailListPref)[EmailIter->first] > 0){
1228 ProcessData.Append(";PREF=");
1229 ProcessData.Append(wxString::Format("%i", (*EmailListPref)[EmailIter->first]));
1233 // Check if there is a value for tokens.
1235 if ((*EmailListTokens)[EmailIter->first].size() > 0){
1237 ProcessData.Append(";");
1238 ProcessData.Append((*EmailListTokens)[EmailIter->first]);
1242 ProcessData.Append(":");
1243 ProcessData.Append(EmailIter->second);
1244 ProcessData.Append("\n");
1246 ProcessData = OutputText(&ProcessData);
1248 SaveData->Append(ProcessData);
1249 ProcessData.clear();
1255 void ContactDataObject::SaveLanguage(map<int, wxString> *LanguageList, map<int, wxString> *LanguageListAltID,
1256 map<int, wxString> *LanguageListPID, map<int, wxString> *LanguageListType,
1257 map<int, int> *LangaugeListPref, map<int, wxString> *LanguageListTokens,
1258 wxString *SaveData, wxString DataType){
1260 wxString ProcessData = "";
1262 for (std::map<int, wxString>::iterator LanguageIter = LanguageList->begin();
1263 LanguageIter != LanguageList->end(); LanguageIter++){
1265 ProcessData.Append("LANG");
1267 // Check if there is a value for TYPE.
1269 if (DataType.size() > 0){
1271 ProcessData.Append(";TYPE=");
1272 ProcessData.Append(DataType);
1276 // Check if there is a value for ALTID.
1278 if ((*LanguageListAltID)[LanguageIter->first].size() > 0){
1280 ProcessData.Append(";ALTID=");
1281 ProcessData.Append((*LanguageListAltID)[LanguageIter->first]);
1285 // Check if there is a value for PID.
1287 if ((*LanguageListPID)[LanguageIter->first].size() > 0){
1289 ProcessData.Append(";PID=");
1290 ProcessData.Append((*LanguageListPID)[LanguageIter->first]);
1294 // Check if there is a value for PREF.
1296 if ((*LangaugeListPref)[LanguageIter->first] > 0){
1298 ProcessData.Append(";PREF=");
1299 ProcessData.Append(wxString::Format("%i", (*LangaugeListPref)[LanguageIter->first]));
1303 // Check if there is a value for tokens.
1305 if ((*LanguageListTokens)[LanguageIter->first].size() > 0){
1307 ProcessData.Append(";");
1308 ProcessData.Append((*LanguageListTokens)[LanguageIter->first]);
1312 ProcessData.Append(":");
1313 ProcessData.Append(LanguageIter->second);
1314 ProcessData.Append("\n");
1316 ProcessData = OutputText(&ProcessData);
1318 SaveData->Append(ProcessData);
1319 ProcessData.clear();
1325 void ContactDataObject::SaveGeoposition(map<int, wxString> *GeographyList, map<int, wxString> *GeographyListAltID,
1326 map<int, wxString> *GeographyListPID, map<int, wxString> *GeographyListType,
1327 map<int, wxString> *GeographyListMediatype, map<int, wxString> *GeographyListDataType,
1328 map<int, int> *GeographyListPref, map<int, wxString> *GeographyListTokens,
1329 wxString *SaveData, wxString DataType){
1331 wxString ProcessData = "";
1333 for (std::map<int, wxString>::iterator GeographyIter = GeographyList->begin();
1334 GeographyIter != GeographyList->end(); GeographyIter++){
1336 ProcessData.Append("GEO");
1338 // Check if there is a value for TYPE.
1340 if (DataType.size() > 0){
1342 ProcessData.Append(";TYPE=");
1343 ProcessData.Append(DataType);
1347 // Check if there is a value for ALTID.
1349 if ((*GeographyListAltID)[GeographyIter->first].size() > 0){
1351 ProcessData.Append(";ALTID=");
1352 ProcessData.Append((*GeographyListAltID)[GeographyIter->first]);
1356 // Check if there is a value for MEDIATYPE.
1358 if ((*GeographyListMediatype)[GeographyIter->first].size() > 0){
1360 ProcessData.Append(";MEDIATYPE=");
1361 ProcessData.Append((*GeographyListMediatype)[GeographyIter->first]);
1365 // Check if there is a value for PID.
1367 if ((*GeographyListPID)[GeographyIter->first].size() > 0){
1369 ProcessData.Append(";PID=");
1370 ProcessData.Append((*GeographyListPID)[GeographyIter->first]);
1374 // Check if there is a value for PREF.
1376 if ((*GeographyListPref)[GeographyIter->first] > 0){
1378 ProcessData.Append(";PREF=");
1379 ProcessData.Append(wxString::Format("%i", (*GeographyListPref)[GeographyIter->first]));
1383 // Check if there is a value for tokens.
1385 if ((*GeographyListTokens)[GeographyIter->first].size() > 0){
1387 ProcessData.Append(";");
1388 ProcessData.Append((*GeographyListTokens)[GeographyIter->first]);
1392 ProcessData.Append(":");
1393 ProcessData.Append((*GeographyListDataType)[GeographyIter->first]);
1394 ProcessData.Append(":");
1395 ProcessData.Append(GeographyIter->second);
1396 ProcessData.Append("\n");
1398 ProcessData = OutputText(&ProcessData);
1400 SaveData->Append(ProcessData);
1401 ProcessData.clear();
1407 void ContactDataObject::SaveURL(map<int, wxString> *WebsiteList, map<int, wxString> *WebsiteListAltID,
1408 map<int, wxString> *WebsiteListPID, map<int, wxString> *WebsiteListType,
1409 map<int, wxString> *WebsiteListMediatype, map<int, int> *WebsiteListPref,
1410 map<int, wxString> *WebsiteListTokens, wxString *SaveData, wxString DataType){
1412 wxString ProcessData = "";
1414 for (std::map<int, wxString>::iterator WebsiteIter = WebsiteList->begin();
1415 WebsiteIter != WebsiteList->end(); WebsiteIter++){
1417 ProcessData.Append("URL");
1419 // Check if there is a value for TYPE.
1421 if (DataType.size() > 0){
1423 ProcessData.Append(";TYPE=");
1424 ProcessData.Append(DataType);
1428 // Check if there is a value for ALTID.
1430 if ((*WebsiteListAltID)[WebsiteIter->first].size() > 0){
1432 ProcessData.Append(";ALTID=");
1433 ProcessData.Append((*WebsiteListAltID)[WebsiteIter->first]);
1437 // Check if there is a value for MEDIATYPE.
1439 if ((*WebsiteListMediatype)[WebsiteIter->first].size() > 0){
1441 ProcessData.Append(";MEDIATYPE=");
1442 ProcessData.Append((*WebsiteListMediatype)[WebsiteIter->first]);
1446 // Check if there is a value for PID.
1448 if ((*WebsiteListPID)[WebsiteIter->first].size() > 0){
1450 ProcessData.Append(";PID=");
1451 ProcessData.Append((*WebsiteListPID)[WebsiteIter->first]);
1455 // Check if there is a value for PREF.
1457 if ((*WebsiteListPref)[WebsiteIter->first] > 0){
1459 ProcessData.Append(";PREF=");
1460 ProcessData.Append(wxString::Format("%i", (*WebsiteListPref)[WebsiteIter->first]));
1464 // Check if there is a value for tokens.
1466 if ((*WebsiteListTokens)[WebsiteIter->first].size() > 0){
1468 ProcessData.Append(";");
1469 ProcessData.Append((*WebsiteListTokens)[WebsiteIter->first]);
1473 ProcessData.Append(":");
1474 ProcessData.Append(WebsiteIter->second);
1475 ProcessData.Append("\n");
1477 ProcessData = OutputText(&ProcessData);
1479 SaveData->Append(ProcessData);
1480 ProcessData.clear();
1486 void ContactDataObject::SaveRole(map<int, wxString> *RoleList, map<int, wxString> *RoleListLanguage,
1487 map<int, wxString> *RoleListAltID, map<int, wxString> *RoleListPID,
1488 map<int, wxString> *RoleListType, map<int, int> *RoleListPref,
1489 map<int, wxString> *RoleListTokens, wxString *SaveData, wxString DataType){
1491 wxString ProcessData = "";
1493 for (std::map<int, wxString>::iterator RoleIter = RoleList->begin();
1494 RoleIter != RoleList->end(); RoleIter++){
1496 ProcessData.Append("ROLE");
1498 // Check if there is a value for TYPE.
1500 if (DataType.size() > 0){
1502 ProcessData.Append(";TYPE=");
1503 ProcessData.Append(DataType);
1507 // Check if there is a value for ALTID.
1509 if ((*RoleListAltID)[RoleIter->first].size() > 0){
1511 ProcessData.Append(";ALTID=");
1512 ProcessData.Append((*RoleListAltID)[RoleIter->first]);
1516 // Check if there is a value for LANGUAGE.
1518 if ((*RoleListLanguage)[RoleIter->first].size() > 0){
1520 ProcessData.Append(";LANGUAGE=");
1521 ProcessData.Append((*RoleListLanguage)[RoleIter->first]);
1525 // Check if there is a value for PID.
1527 if ((*RoleListPID)[RoleIter->first].size() > 0){
1529 ProcessData.Append(";PID=");
1530 ProcessData.Append((*RoleListPID)[RoleIter->first]);
1534 // Check if there is a value for PREF.
1536 if ((*RoleListPref)[RoleIter->first] > 0){
1538 ProcessData.Append(";PREF=");
1539 ProcessData.Append(wxString::Format("%i", (*RoleListPref)[RoleIter->first]));
1543 // Check if there is a value for tokens.
1545 if ((*RoleListTokens)[RoleIter->first].size() > 0){
1547 ProcessData.Append(";");
1548 ProcessData.Append((*RoleListTokens)[RoleIter->first]);
1552 ProcessData.Append(":");
1553 ProcessData.Append(RoleIter->second);
1554 ProcessData.Append("\n");
1556 ProcessData = OutputText(&ProcessData);
1558 SaveData->Append(ProcessData);
1559 ProcessData.clear();
1565 void ContactDataObject::SaveOrganisation(map<int, wxString> *OrganisationList, map<int, wxString> *OrganisationListAltID,
1566 map<int, wxString> *OrganisationListPID, map<int, wxString> *OrganisationListLanguage,
1567 map<int, wxString> *OrganisationListSortAs, map<int, wxString> *OrganisationListType,
1568 map<int, int> *OrganisationListPref, map<int, wxString> *OrganisationListTokens,
1569 wxString *SaveData, wxString DataType){
1571 wxString ProcessData = "";
1573 for (std::map<int, wxString>::iterator OrganisationIter = OrganisationList->begin();
1574 OrganisationIter != OrganisationList->end(); OrganisationIter++){
1576 ProcessData.Append("ORG");
1578 // Check if there is a value for TYPE.
1580 if (DataType.size() > 0){
1582 ProcessData.Append(";TYPE=");
1583 ProcessData.Append(DataType);
1587 // Check if there is a value for ALTID.
1589 if ((*OrganisationListAltID)[OrganisationIter->first].size() > 0){
1591 ProcessData.Append(";ALTID=");
1592 ProcessData.Append((*OrganisationListAltID)[OrganisationIter->first]);
1596 // Check if there is a value for LANGUAGE.
1598 if ((*OrganisationListLanguage)[OrganisationIter->first].size() > 0){
1600 ProcessData.Append(";LANGUAGE=");
1601 ProcessData.Append((*OrganisationListLanguage)[OrganisationIter->first]);
1605 // Check if there is a value for PID.
1607 if ((*OrganisationListPID)[OrganisationIter->first].size() > 0){
1609 ProcessData.Append(";PID=");
1610 ProcessData.Append((*OrganisationListPID)[OrganisationIter->first]);
1614 // Check if there is a value for PREF.
1616 if ((*OrganisationListPref)[OrganisationIter->first] > 0){
1618 ProcessData.Append(";PREF=");
1619 ProcessData.Append(wxString::Format("%i", (*OrganisationListPref)[OrganisationIter->first]));
1623 // Check if there is a value for SORT-AS.
1625 if ((*OrganisationListSortAs)[OrganisationIter->first].size() > 0){
1627 ProcessData.Append(";SORT-AS=\"");
1628 ProcessData.Append((*OrganisationListSortAs)[OrganisationIter->first]);
1629 ProcessData.Append("\"");
1633 // Check if there is a value for tokens.
1635 if ((*OrganisationListTokens)[OrganisationIter->first].size() > 0){
1637 ProcessData.Append(";");
1638 ProcessData.Append((*OrganisationListTokens)[OrganisationIter->first]);
1642 ProcessData.Append(":");
1643 ProcessData.Append(OrganisationIter->second);
1644 ProcessData.Append("\n");
1646 ProcessData = OutputText(&ProcessData);
1648 SaveData->Append(ProcessData);
1649 ProcessData.clear();
1655 void ContactDataObject::SaveNote(map<int, wxString> *NoteList, map<int, wxString> *NoteListLanguage,
1656 map<int, wxString> *NoteListAltID, map<int, wxString> *NoteListPID,
1657 map<int, wxString> *NoteListType, map<int, int> *NoteListPref,
1658 map<int, wxString> *NoteListTokens, wxString *SaveData, wxString DataType){
1660 wxString ProcessData = "";
1662 for (std::map<int, wxString>::iterator NoteIter = NoteList->begin();
1663 NoteIter != NoteList->end(); NoteIter++){
1665 ProcessData.Append("NOTE");
1667 // Check if there is a value for TYPE.
1669 if (DataType.size() > 0){
1671 ProcessData.Append(";TYPE=");
1672 ProcessData.Append(DataType);
1676 // Check if there is a value for ALTID.
1678 if ((*NoteListAltID)[NoteIter->first].size() > 0){
1680 ProcessData.Append(";ALTID=");
1681 ProcessData.Append((*NoteListAltID)[NoteIter->first]);
1685 // Check if there is a value for LANGUAGE.
1687 if ((*NoteListLanguage)[NoteIter->first].size() > 0){
1689 ProcessData.Append(";LANGUAGE=");
1690 ProcessData.Append((*NoteListLanguage)[NoteIter->first]);
1694 // Check if there is a value for PID.
1696 if ((*NoteListPID)[NoteIter->first].size() > 0){
1698 ProcessData.Append(";PID=");
1699 ProcessData.Append((*NoteListPID)[NoteIter->first]);
1703 // Check if there is a value for PREF.
1705 if ((*NoteListPref)[NoteIter->first] > 0){
1707 ProcessData.Append(";PREF=");
1708 ProcessData.Append(wxString::Format("%i", (*NoteListPref)[NoteIter->first]));
1712 // Check if there is a value for tokens.
1714 if ((*NoteListTokens)[NoteIter->first].size() > 0){
1716 ProcessData.Append(";");
1717 ProcessData.Append((*NoteListTokens)[NoteIter->first]);
1721 ProcessData.Append(":");
1722 ProcessData.Append(NoteIter->second);
1723 ProcessData.Replace("\n", "\\n", true);
1724 ProcessData.Append("\n");
1726 ProcessData = OutputText(&ProcessData);
1728 SaveData->Append(ProcessData);
1729 ProcessData.clear();
1735 void ContactDataObject::SaveCategory(map<int, wxString> *CategoryList, map<int, wxString> *CategoryListLanguage,
1736 map<int, wxString> *CategoryListAltID, map<int, wxString> *CategoryListPID,
1737 map<int, wxString> *CategoryListType, map<int, int> *CategoryListPref,
1738 map<int, wxString> *CategoryListTokens, wxString *SaveData){
1740 wxString ProcessData = "";
1742 for (std::map<int, wxString>::iterator CategoryIter = CategoryList->begin();
1743 CategoryIter != CategoryList->end(); CategoryIter++){
1745 ProcessData.Append("CATEGORIES");
1747 // Check if there is a value for TYPE.
1749 if ((*CategoryListType)[CategoryIter->first].size() > 0){
1751 ProcessData.Append(";TYPE=");
1752 ProcessData.Append((*CategoryListType)[CategoryIter->first]);
1756 // Check if there is a value for ALTID.
1758 if ((*CategoryListAltID)[CategoryIter->first].size() > 0){
1760 ProcessData.Append(";ALTID=");
1761 ProcessData.Append((*CategoryListAltID)[CategoryIter->first]);
1765 // Check if there is a value for LANGUAGE.
1767 if ((*CategoryListLanguage)[CategoryIter->first].size() > 0){
1769 ProcessData.Append(";LANGUAGE=");
1770 ProcessData.Append((*CategoryListLanguage)[CategoryIter->first]);
1774 // Check if there is a value for PID.
1776 if ((*CategoryListPID)[CategoryIter->first].size() > 0){
1778 ProcessData.Append(";PID=");
1779 ProcessData.Append((*CategoryListPID)[CategoryIter->first]);
1783 // Check if there is a value for PREF.
1785 if ((*CategoryListPref)[CategoryIter->first] > 0){
1787 ProcessData.Append(";PREF=");
1788 ProcessData.Append(wxString::Format("%i", (*CategoryListPref)[CategoryIter->first]));
1792 // Check if there is a value for tokens.
1794 if ((*CategoryListTokens)[CategoryIter->first].size() > 0){
1796 ProcessData.Append(";");
1797 ProcessData.Append((*CategoryListTokens)[CategoryIter->first]);
1801 ProcessData.Append(":");
1802 ProcessData.Append(CategoryIter->second);
1803 ProcessData.Append("\n");
1805 ProcessData = OutputText(&ProcessData);
1807 SaveData->Append(ProcessData);
1808 ProcessData.clear();
1814 void ContactDataObject::SavePhoto(map<int, string> *PicturesList, map<int, wxString> *PicturesListAltID,
1815 map<int, wxString> *PicturesListPID, map<int, wxString> *PicturesListType,
1816 map<int, wxString> *PicturesListPicEncType, map<int, wxString> *PicturesListPictureType,
1817 map<int, wxString> *PicturesListMediatype, map<int, int> *PicturesListPref,
1818 map<int, wxString> *PicturesListTokens, wxString *SaveData){
1820 wxString ProcessData = "";
1822 for (std::map<int, string>::iterator PicturesIter = PicturesList->begin();
1823 PicturesIter != PicturesList->end(); PicturesIter++){
1825 ProcessData.Append("PHOTO");
1827 // Check if there is a value for TYPE.
1829 if ((*PicturesListType)[PicturesIter->first].size() > 0){
1831 ProcessData.Append(";TYPE=");
1832 ProcessData.Append((*PicturesListType)[PicturesIter->first]);
1836 // Check if there is a value for ALTID.
1838 if ((*PicturesListAltID)[PicturesIter->first].size() > 0){
1840 ProcessData.Append(";ALTID=");
1841 ProcessData.Append((*PicturesListAltID)[PicturesIter->first]);
1845 // Check if there is a value for MEDIATYPE..
1847 if ((*PicturesListMediatype)[PicturesIter->first].size() > 0){
1849 ProcessData.Append(";MEDIATYPE=");
1850 ProcessData.Append((*PicturesListMediatype)[PicturesIter->first]);
1854 // Check if there is a value for PID.
1856 if ((*PicturesListPID)[PicturesIter->first].size() > 0){
1858 ProcessData.Append(";PID=");
1859 ProcessData.Append((*PicturesListPID)[PicturesIter->first]);
1863 // Check if there is a value for PREF.
1865 if ((*PicturesListPref)[PicturesIter->first] > 0){
1867 ProcessData.Append(";PREF=");
1868 ProcessData.Append(wxString::Format("%i", (*PicturesListPref)[PicturesIter->first]));
1872 // Check if there is a value for tokens.
1874 if ((*PicturesListTokens)[PicturesIter->first].size() > 0){
1876 ProcessData.Append(";");
1877 ProcessData.Append((*PicturesListTokens)[PicturesIter->first]);
1881 ProcessData.Append(":data:");
1882 ProcessData.Append((*PicturesListPictureType)[PicturesIter->first]);
1883 ProcessData.Append(";");
1884 ProcessData.Append((*PicturesListPicEncType)[PicturesIter->first]);
1885 ProcessData.Append(",");
1886 ProcessData.Append(PicturesIter->second);
1887 ProcessData.Append("\n");
1889 ProcessData = OutputText(&ProcessData);
1891 SaveData->Append(ProcessData);
1892 ProcessData.clear();
1898 void ContactDataObject::SaveLogo(map<int, string> *LogosList, map<int, wxString> *LogosListAltID,
1899 map<int, wxString> *LogosListPID, map<int, wxString> *LogosListType,
1900 map<int, wxString> *LogosListPicEncType, map<int, wxString> *LogosListPictureType,
1901 map<int, wxString> *LogosListMediatype, map<int, int> *LogosListPref,
1902 map<int, wxString> *LogosListTokens, wxString *SaveData){
1904 wxString ProcessData = "";
1906 for (std::map<int, string>::iterator LogosIter = LogosList->begin();
1907 LogosIter != LogosList->end(); LogosIter++){
1909 ProcessData.Append("LOGO");
1911 // Check if there is a value for TYPE.
1913 if ((*LogosListType)[LogosIter->first].size() > 0){
1915 ProcessData.Append(";TYPE=");
1916 ProcessData.Append((*LogosListType)[LogosIter->first]);
1920 // Check if there is a value for ALTID.
1922 if ((*LogosListAltID)[LogosIter->first].size() > 0){
1924 ProcessData.Append(";ALTID=");
1925 ProcessData.Append((*LogosListAltID)[LogosIter->first]);
1929 // Check if there is a value for MEDIATYPE..
1931 if ((*LogosListMediatype)[LogosIter->first].size() > 0){
1933 ProcessData.Append(";MEDIATYPE=");
1934 ProcessData.Append((*LogosListMediatype)[LogosIter->first]);
1938 // Check if there is a value for PID.
1940 if ((*LogosListPID)[LogosIter->first].size() > 0){
1942 ProcessData.Append(";PID=");
1943 ProcessData.Append((*LogosListPID)[LogosIter->first]);
1947 // Check if there is a value for PREF.
1949 if ((*LogosListPref)[LogosIter->first] > 0){
1951 ProcessData.Append(";PREF=");
1952 ProcessData.Append(wxString::Format("%i", (*LogosListPref)[LogosIter->first]));
1956 // Check if there is a value for tokens.
1958 if ((*LogosListTokens)[LogosIter->first].size() > 0){
1960 ProcessData.Append(";");
1961 ProcessData.Append((*LogosListTokens)[LogosIter->first]);
1965 ProcessData.Append(":data:");
1966 ProcessData.Append((*LogosListPictureType)[LogosIter->first]);
1967 ProcessData.Append(";");
1968 ProcessData.Append((*LogosListPicEncType)[LogosIter->first]);
1969 ProcessData.Append(",");
1970 ProcessData.Append(LogosIter->second);
1971 ProcessData.Append("\n");
1973 ProcessData = OutputText(&ProcessData);
1975 SaveData->Append(ProcessData);
1976 ProcessData.clear();
1982 void ContactDataObject::SaveSound(map<int, string> *SoundsList, map<int, wxString> *SoundsListAltID,
1983 map<int, wxString> *SoundsListPID, map<int, wxString> *SoundsListType,
1984 map<int, wxString> *SoundsListAudioEncType, map<int, wxString> *SoundsListAudioType,
1985 map<int, wxString> *SoundsListMediatype, map<int, wxString> *SoundsListLanguage,
1986 map<int, int> *SoundsListPref, map<int, wxString> *SoundsListTokens,
1987 wxString *SaveData){
1989 wxString ProcessData = "";
1991 for (std::map<int, string>::iterator SoundsIter = SoundsList->begin();
1992 SoundsIter != SoundsList->end(); SoundsIter++){
1994 ProcessData.Append("SOUND");
1996 // Check if there is a value for TYPE.
1998 if ((*SoundsListType)[SoundsIter->first].size() > 0){
2000 ProcessData.Append(";TYPE=");
2001 ProcessData.Append((*SoundsListType)[SoundsIter->first]);
2005 // Check if there is a value for ALTID.
2007 if ((*SoundsListAltID)[SoundsIter->first].size() > 0){
2009 ProcessData.Append(";ALTID=");
2010 ProcessData.Append((*SoundsListAltID)[SoundsIter->first]);
2014 // Check if there is a value for LANGUAGE.
2016 if ((*SoundsListLanguage)[SoundsIter->first].size() > 0){
2018 ProcessData.Append(";LANGUAGE=");
2019 ProcessData.Append((*SoundsListLanguage)[SoundsIter->first]);
2023 // Check if there is a value for MEDIATYPE.
2025 if ((*SoundsListMediatype)[SoundsIter->first].size() > 0){
2027 ProcessData.Append(";MEDIATYPE=");
2028 ProcessData.Append((*SoundsListMediatype)[SoundsIter->first]);
2032 // Check if there is a value for PID.
2034 if ((*SoundsListPID)[SoundsIter->first].size() > 0){
2036 ProcessData.Append(";PID=");
2037 ProcessData.Append((*SoundsListPID)[SoundsIter->first]);
2041 // Check if there is a value for PREF.
2043 if ((*SoundsListPref)[SoundsIter->first] > 0){
2045 ProcessData.Append(";PREF=");
2046 ProcessData.Append(wxString::Format("%i", (*SoundsListPref)[SoundsIter->first]));
2050 // Check if there is a value for tokens.
2052 if ((*SoundsListTokens)[SoundsIter->first].size() > 0){
2054 ProcessData.Append(";");
2055 ProcessData.Append((*SoundsListTokens)[SoundsIter->first]);
2059 ProcessData.Append(":data:");
2060 ProcessData.Append((*SoundsListAudioType)[SoundsIter->first]);
2061 ProcessData.Append(";");
2062 ProcessData.Append((*SoundsListAudioEncType)[SoundsIter->first]);
2063 ProcessData.Append(",");
2064 ProcessData.Append(SoundsIter->second);
2065 ProcessData.Append("\n");
2067 ProcessData = OutputText(&ProcessData);
2069 SaveData->Append(ProcessData);
2070 ProcessData.clear();
2076 void ContactDataObject::SaveCalendarURI(map<int, wxString> *CalendarList, map<int, wxString> *CalendarListMediatype,
2077 map<int, wxString> *CalendarListAltID, map<int, wxString> *CalendarListPID,
2078 map<int, wxString> *CalendarListType, map<int, int> *CalendarListPref,
2079 map<int, wxString> *CalendarListTokens, wxString *SaveData){
2081 wxString ProcessData = "";
2083 for (std::map<int, wxString>::iterator CalendarIter = CalendarList->begin();
2084 CalendarIter != CalendarList->end(); CalendarIter++){
2086 ProcessData.Append("CALURI");
2088 // Check if there is a value for TYPE.
2090 if ((*CalendarListType)[CalendarIter->first].size() > 0){
2092 ProcessData.Append(";TYPE=");
2093 ProcessData.Append((*CalendarListType)[CalendarIter->first]);
2097 // Check if there is a value for ALTID.
2099 if ((*CalendarListAltID)[CalendarIter->first].size() > 0){
2101 ProcessData.Append(";ALTID=");
2102 ProcessData.Append((*CalendarListAltID)[CalendarIter->first]);
2106 // Check if there is a value for MEDIATYPE.
2108 if ((*CalendarListMediatype)[CalendarIter->first].size() > 0){
2110 ProcessData.Append(";MEDIATYPE=");
2111 ProcessData.Append((*CalendarListMediatype)[CalendarIter->first]);
2115 // Check if there is a value for PID.
2117 if ((*CalendarListPID)[CalendarIter->first].size() > 0){
2119 ProcessData.Append(";PID=");
2120 ProcessData.Append((*CalendarListPID)[CalendarIter->first]);
2124 // Check if there is a value for PREF.
2126 if ((*CalendarListPref)[CalendarIter->first] > 0){
2128 ProcessData.Append(";PREF=");
2129 ProcessData.Append(wxString::Format("%i", (*CalendarListPref)[CalendarIter->first]));
2133 // Check if there is a value for tokens.
2135 if ((*CalendarListTokens)[CalendarIter->first].size() > 0){
2137 ProcessData.Append(";");
2138 ProcessData.Append((*CalendarListTokens)[CalendarIter->first]);
2142 ProcessData.Append(":");
2143 ProcessData.Append(CalendarIter->second);
2144 ProcessData.Append("\n");
2146 ProcessData = OutputText(&ProcessData);
2148 SaveData->Append(ProcessData);
2149 ProcessData.clear();
2155 void ContactDataObject::SaveCalendarRequestURI(map<int, wxString> *CalendarRequestList, map<int, wxString> *CalendarRequestListMediatype,
2156 map<int, wxString> *CalendarRequestListAltID, map<int, wxString> *CalendarRequestListPID,
2157 map<int, wxString> *CalendarRequestListType, map<int, int> *CalendarRequestListPref,
2158 map<int, wxString> *CalendarRequestListTokens, wxString *SaveData){
2160 wxString ProcessData = "";
2162 for (std::map<int, wxString>::iterator CalendarRequestIter = CalendarRequestList->begin();
2163 CalendarRequestIter != CalendarRequestList->end(); CalendarRequestIter++){
2165 ProcessData.Append("CALADRURI");
2167 // Check if there is a value for TYPE.
2169 if ((*CalendarRequestListType)[CalendarRequestIter->first].size() > 0){
2171 ProcessData.Append(";TYPE=");
2172 ProcessData.Append((*CalendarRequestListType)[CalendarRequestIter->first]);
2176 // Check if there is a value for ALTID.
2178 if ((*CalendarRequestListAltID)[CalendarRequestIter->first].size() > 0){
2180 ProcessData.Append(";ALTID=");
2181 ProcessData.Append((*CalendarRequestListAltID)[CalendarRequestIter->first]);
2185 // Check if there is a value for MEDIATYPE.
2187 if ((*CalendarRequestListMediatype)[CalendarRequestIter->first].size() > 0){
2189 ProcessData.Append(";MEDIATYPE=");
2190 ProcessData.Append((*CalendarRequestListMediatype)[CalendarRequestIter->first]);
2194 // Check if there is a value for PID.
2196 if ((*CalendarRequestListPID)[CalendarRequestIter->first].size() > 0){
2198 ProcessData.Append(";PID=");
2199 ProcessData.Append((*CalendarRequestListPID)[CalendarRequestIter->first]);
2203 // Check if there is a value for PREF.
2205 if ((*CalendarRequestListPref)[CalendarRequestIter->first] > 0){
2207 ProcessData.Append(";PREF=");
2208 ProcessData.Append(wxString::Format("%i", (*CalendarRequestListPref)[CalendarRequestIter->first]));
2212 // Check if there is a value for tokens.
2214 if ((*CalendarRequestListTokens)[CalendarRequestIter->first].size() > 0){
2216 ProcessData.Append(";");
2217 ProcessData.Append((*CalendarRequestListTokens)[CalendarRequestIter->first]);
2221 ProcessData.Append(":");
2222 ProcessData.Append(CalendarRequestIter->second);
2223 ProcessData.Append("\n");
2225 ProcessData = OutputText(&ProcessData);
2227 SaveData->Append(ProcessData);
2228 ProcessData.clear();
2234 void ContactDataObject::SaveFreeBusyURI(std::map<int, wxString> *FreeBusyList, std::map<int, wxString> *FreeBusyListAltID,
2235 std::map<int, wxString> *FreeBusyListPID, std::map<int, wxString> *FreeBusyListType,
2236 std::map<int, wxString> *FreeBusyListMediatype, std::map<int, int> *FreeBusyListPref,
2237 std::map<int, wxString> *FreeBusyListTokens, wxString *SaveData){
2239 wxString ProcessData = "";
2241 for (std::map<int, wxString>::iterator FreeBusyIter = FreeBusyList->begin();
2242 FreeBusyIter != FreeBusyList->end(); FreeBusyIter++){
2244 ProcessData.Append("FBURL");
2246 // Check if there is a value for TYPE.
2248 if ((*FreeBusyListType)[FreeBusyIter->first].size() > 0){
2250 ProcessData.Append(";TYPE=");
2251 ProcessData.Append((*FreeBusyListType)[FreeBusyIter->first]);
2255 // Check if there is a value for ALTID.
2257 if ((*FreeBusyListAltID)[FreeBusyIter->first].size() > 0){
2259 ProcessData.Append(";ALTID=");
2260 ProcessData.Append((*FreeBusyListAltID)[FreeBusyIter->first]);
2264 // Check if there is a value for MEDIATYPE.
2266 if ((*FreeBusyListMediatype)[FreeBusyIter->first].size() > 0){
2268 ProcessData.Append(";MEDIATYPE=");
2269 ProcessData.Append((*FreeBusyListMediatype)[FreeBusyIter->first]);
2273 // Check if there is a value for PID.
2275 if ((*FreeBusyListPID)[FreeBusyIter->first].size() > 0){
2277 ProcessData.Append(";PID=");
2278 ProcessData.Append((*FreeBusyListPID)[FreeBusyIter->first]);
2282 // Check if there is a value for PREF.
2284 if ((*FreeBusyListPref)[FreeBusyIter->first] > 0){
2286 ProcessData.Append(";PREF=");
2287 ProcessData.Append(wxString::Format("%i", (*FreeBusyListPref)[FreeBusyIter->first]));
2291 // Check if there is a value for tokens.
2293 if ((*FreeBusyListTokens)[FreeBusyIter->first].size() > 0){
2295 ProcessData.Append(";");
2296 ProcessData.Append((*FreeBusyListTokens)[FreeBusyIter->first]);
2300 ProcessData.Append(":");
2301 ProcessData.Append(FreeBusyIter->second);
2302 ProcessData.Append("\n");
2304 ProcessData = OutputText(&ProcessData);
2306 SaveData->Append(ProcessData);
2307 ProcessData.clear();
2313 void ContactDataObject::SaveKey(map<int, wxString> *KeyList, map<int, wxString> *KeyListAltID,
2314 map<int, wxString> *KeyListPID, map<int, wxString> *KeyListType,
2315 map<int, bool> *KeyListKeyType, map<int, wxString> *KeyListDataEncType,
2316 map<int, wxString> *KeyListDataType, map<int, int> *KeyListPref,
2317 map<int, wxString> *KeyListTokens, wxString *SaveData){
2319 wxString ProcessData = "";
2321 for (std::map<int, wxString>::iterator KeyIter = KeyList->begin();
2322 KeyIter != KeyList->end(); KeyIter++){
2324 ProcessData.Append("KEY");
2326 // Check if there is a value for TYPE.
2328 if ((*KeyListType)[KeyIter->first].size() > 0){
2330 ProcessData.Append(";TYPE=");
2331 ProcessData.Append((*KeyListType)[KeyIter->first]);
2335 // Check if there is a value for ALTID.
2337 if ((*KeyListAltID)[KeyIter->first].size() > 0){
2339 ProcessData.Append(";ALTID=");
2340 ProcessData.Append((*KeyListAltID)[KeyIter->first]);
2344 // Check if there is a value for PID.
2346 if ((*KeyListPID)[KeyIter->first].size() > 0){
2348 ProcessData.Append(";PID=");
2349 ProcessData.Append((*KeyListPID)[KeyIter->first]);
2353 // Check if there is a value for PREF.
2355 if ((*KeyListPref)[KeyIter->first] > 0){
2357 ProcessData.Append(";PREF=");
2358 ProcessData.Append(wxString::Format("%i", (*KeyListPref)[KeyIter->first]));
2362 // Check if there is a value for tokens.
2364 if ((*KeyListTokens)[KeyIter->first].size() > 0){
2366 ProcessData.Append(";");
2367 ProcessData.Append((*KeyListTokens)[KeyIter->first]);
2371 ProcessData.Append(":data:");
2372 ProcessData.Append((*KeyListDataType)[KeyIter->first]);
2373 ProcessData.Append(";");
2374 ProcessData.Append((*KeyListDataEncType)[KeyIter->first]);
2375 ProcessData.Append(",");
2376 ProcessData.Append(KeyIter->second);
2377 ProcessData.Append("\n");
2379 ProcessData = OutputText(&ProcessData);
2381 SaveData->Append(ProcessData);
2382 ProcessData.clear();
2388 void ContactDataObject::SaveVendor(map<int, wxString> *VendorList, map<int, wxString> *VendorListPEN,
2389 map<int, wxString> *VendorListElement, wxString *SaveData){
2391 wxString ProcessData = "";
2393 for (std::map<int, wxString>::iterator VendorIter = VendorList->begin();
2394 VendorIter != VendorList->end(); VendorIter++){
2396 ProcessData.Append("VND-");
2397 ProcessData.Append((*VendorListPEN)[VendorIter->first]);
2398 ProcessData.Append("-");
2399 ProcessData.Append((*VendorListElement)[VendorIter->first]);
2400 ProcessData.Append(":");
2401 ProcessData.Append(VendorIter->second);
2402 ProcessData.Append("\n");
2404 ProcessData = OutputText(&ProcessData);
2406 SaveData->Append(ProcessData);
2407 ProcessData.clear();
2413 void ContactDataObject::SaveXToken(map<int, wxString> *XTokenList, map<int, wxString> *XTokenListTokens,
2414 wxString *SaveData){
2416 wxString ProcessData = "";
2418 for (std::map<int, wxString>::iterator XTokenIter = XTokenList->begin();
2419 XTokenIter != XTokenList->end(); XTokenIter++){
2421 ProcessData.Append("X-");
2422 ProcessData.Append((*XTokenListTokens)[XTokenIter->first]);
2423 ProcessData.Append(":");
2424 ProcessData.Append(XTokenIter->second);
2425 ProcessData.Append("\n");
2427 ProcessData = OutputText(&ProcessData);
2429 SaveData->Append(ProcessData);
2430 ProcessData.clear();