Home | News | Projects | Releases
Bugs | RFE | Repositories | Help
Added comments to describe vCard34Conv::ConvertToV4
[xestiaab/.git] / source / vcard / vcard34conv-v4conv.cpp
1 // vcard34conv-v4conv.cpp - vCard34Conv Object vCard4 conversion subroutines.
2 //
3 // (c) 2012-2015 Xestia Software Development.
4 //
5 // This file is part of Xestia Address Book.
6 //
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.
10 //
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.
15 //
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 "vcard34conv.h"
20 #include "vcard.h"
21 #include "../version.h"
22 #include "../common/textprocessing.h"
24 #include <wx/ffile.h>
25 #include <wx/tokenzr.h>
26 #include <wx/datetime.h>
27 #include <wx/wx.h>
29 bool vCard34Conv::ConvertToV4(wxString *wxSData, vCard *vCardOut){
30         
31         // Convert a vCard 3.0 format into the vCard 4.0 format.
32         
33         std::map<int, wxString> ContactFileLines;
34         std::map<int, bool> ContactFileProcessed;
35         std::map<int, bool> ContactFileProcessedWorking;
36         std::map<int, wxString>::iterator striter;
37         std::map<int,bool>::iterator iterbool;
38         std::map<int,bool>::iterator iterboolsub;
39         wxString ContactLineRec;
41         // Process the received data.
42         
43         wxStringTokenizer wSTContactFileLines(*wxSData, wxT("\r\n"));
45         int ContactLineSeek = 0;
47         while (wSTContactFileLines.HasMoreTokens() == TRUE){
49                 ContactLineRec = wSTContactFileLines.GetNextToken();
50                 ContactFileLines.insert(std::make_pair(ContactLineSeek, ContactLineRec));
51                 ContactFileProcessed.insert(std::make_pair(ContactLineSeek, FALSE));
52                 ContactLineSeek++;              
53         
54         }
55         
56         bool QuoteMode = FALSE;
57         bool PropertyFind = TRUE;
58         bool ExtraLineSeek = TRUE;
59         bool ExtraLineSeekSub = TRUE;
60         bool BirthdayProcessed = FALSE;
61         bool AnniversaryProcessed = FALSE;
62         bool FNProcessed = FALSE;
63         bool GenderProcessed = FALSE;
64         bool NameProcessed = FALSE;
65         bool FNFirst = FALSE;
66         bool NicknameFirst = FALSE;
67         bool TitleFirst = FALSE;
68         bool OrganisationFirst = FALSE;
69         bool NoteFirst = FALSE;
70         bool PhotoFirst = FALSE;
71         bool LogoFirst = FALSE;
72         bool NameFirst = FALSE;
73         bool FoundData = FALSE;
74         int intExtraNickname = 0;
75         wxString wxSProperty;
76         wxString wxSPropertyVCARD4;
77         wxString wxSPropertySeg1;
78         wxString wxSPropertySeg2;
79         wxString wxSPropertyNextLine;
80         wxString ContactLine;
81         wxString ContactLineSub;
82         wxString PropertyName;
83         wxString PropertyValue;
84         wxString PropertyDataStr;
85         size_t ContactLineLen = 0;
86         size_t ContactLineSubLen = 0;
87         int QuoteBreakPoint = 0;
88         size_t intPrevValueSub = 0;
90         std::map<wxString, wxString> PropertyData;
91         std::map<wxString, bool> PropertyLock;
92         std::map<wxString, wxString> TempPropertyData;
93         std::map<wxString, bool> TempPropertyLock;
94         std::map<int, int> TempSplitPoints;
95         std::map<int, int> TempSplitLength;
96         std::map<int, int>::iterator SLiter;
98         wxString PropertFindSub;
99         wxString wxSPropertySub;
100         wxString wxSPropertySeg1Sub;
101         wxString wxSPropertySeg2Sub;
102         wxString wxSPropertyValues;
103         wxString wxSPropertyData;
104         wxString wxSPropertyNameConv;
105         wxString wxSPropertyXVCard4Value;
106         wxString ItemProcString;
107         
108         bool XVCard4Value = FALSE;
109         bool VCard3Value = FALSE;
110         bool SeekItemData = FALSE;
111         
112         wxString strVer;
113     
114         // Setup the version string.
115         
116         strVer.Append(wxT("-//Xestia//Address Book Version "));
117         strVer.Append(wxT(XSDAB_VERSION));
118         strVer.Append(wxT("//KW"));
119         
120         vCardOut->AddRaw(wxT("BEGIN"), wxT("VCARD"));
121         vCardOut->AddRaw(wxT("VERSION"), wxT("4.0"));
122         vCardOut->AddRaw(wxT("PRODID"), strVer);
123         
124                 // FN
125                 // NICKNAME
126                 // TITLE
127                 // ORG
128                 // NOTE
129                 // PHOTO
130                 
131         // Process the properties which have X-FIRST.
132         
133         // Clone the ContactFileProcessed into ContactFileProcessedWorking.
135         ContactFileProcessedWorking.insert(ContactFileProcessed.begin(), ContactFileProcessed.end());
137         for (std::map<int,wxString>::iterator iter = ContactFileLines.begin(); 
138          iter != ContactFileLines.end(); ++iter){
139          
140                 ExtraLineSeek = TRUE;
142                 iterbool = ContactFileProcessed.find(iter->first);
143                 
144                 ContactLine = iter->second;
145                 
146                 // Ignore certain variables as they are not needed.
147                 
148                 if (ContactLine == wxT("BEGIN:VCARD") || 
149                 ContactLine == wxT("END:VCARD") || 
150                 ContactLine.Mid(0, 8) == wxT("VERSION:") || 
151                 ContactLine.Mid(0, 7) == wxT("PRODID:") || 
152                 ContactLine.Mid(0, 5) == wxT("X-AIM") || 
153                 ContactLine.Mid(0, 5) == wxT("X-MSN") || 
154                 ContactLine.Mid(0, 5) == wxT("X-ICQ") || 
155                 ContactLine.Mid(0, 10) == wxT("X-GADUGADU") || 
156                 ContactLine.Mid(0, 7) == wxT("X-YAHOO") || 
157                 ContactLine.Mid(0, 7) == wxT("X-SKYPE") || 
158                 ContactLine.Mid(0, 8) == wxT("X-JABBER") ||
159                 ContactLine.Mid(0, 4) == wxT("REV:")){
160                         
161                         iterbool->second = TRUE;
162                         continue;
163                         
164                 }
165                 
166                 if (iterbool->second == TRUE){
167                         
168                         continue;
169                         
170                 }
171                 
172                 if (ContactLine.Mid(0, 1) == wxT(" ") || ContactLine.Mid(0, 1) == wxT("\t")){
173                 
174                         continue;
175                 
176                 }
177         
178                 if (ContactLine.Mid(0, 4) == wxT("item")){
179                 
180                         // Line is a itemn... so ignore.
181                 
182                         continue;
183                 
184                 }
185                 
186                 std::map<int,int> DataLineProcess;
187                 std::map<int, bool>::iterator DLSLiter;
188                 std::map<int,int> DataLineProcessOriginal;
189                 int DataLineSeek = 0;
190                 int DataLineSeekOrig = 0;
192                 std::map<int,wxString>::iterator itersub = iter;
193                 DataLineProcessOriginal.insert(std::make_pair(DataLineSeekOrig, iterbool->first));
194                 DataLineSeekOrig++;
196                 while (ExtraLineSeek == TRUE){
197                 
198                         // Check if there is extra data on the next line 
199                         // (indicated by space or tab at the start) and add data.
200                 
201                         itersub++;
203                         if (itersub == ContactFileLines.end()){
205                                 break;
207                         }
209                         iterboolsub = ContactFileProcessed.find(itersub->first);
211                         if (iterboolsub == ContactFileProcessed.end()){
212                         
213                                 break;
214                         
215                         }
216                         
217                         if (iterboolsub->second == TRUE){
218                         
219                                 continue;
220                         
221                         }               
222                 
223                         wxSPropertyNextLine = itersub->second;
224                 
225                         if (wxSPropertyNextLine.Mid(0, 1) == wxT(" ") || wxSPropertyNextLine.Mid(0, 1) == wxT("\t")){
226                 
227                                 wxSPropertyNextLine.Remove(0, 1);
228                                 //wxSPropertyNextLine.Trim(FALSE);
229                                 //ContactLine.Trim();
230                                 ContactLine.Append(wxSPropertyNextLine);
231                                 DataLineProcessOriginal.insert(std::make_pair(DataLineSeekOrig, iterboolsub->first));
232                                 DataLineSeekOrig++;
233                                 //iterboolsub->second = TRUE;
234                 
235                         } else {
236                         
237                                 ExtraLineSeek = FALSE;
238                         
239                         }
240                 
241                 }
242                 
243                 ContactLineLen = ContactLine.Len();
244                 
245                 for (int i = 0; i <= ContactLineLen; i++){
246                 
247                         if ((ContactLine.Mid(i, 1) == wxT(";") || ContactLine.Mid(i, 1) == wxT(":")) && PropertyFind == TRUE){
248                         
249                                 PropertyFind = FALSE;
250                         
251                         } else if (PropertyFind == TRUE){
252                         
253                                 wxSProperty.Append(ContactLine.Mid(i, 1));
254                         
255                         }               
256                 
257                         if (ContactLine.Mid(i, 1) == wxT("\"")){
258                         
259                                 if (QuoteMode == TRUE){
260                                 
261                                         QuoteMode = FALSE;
262                                 
263                                 } else {
264                         
265                                         QuoteMode = TRUE;
266                                         
267                                 }
268                         
269                         }
270                         
271                         if (ContactLine.Mid(i, 1) == wxT(":") && ContactLine.Mid((i - 1), 1) != wxT("\\") && QuoteMode == FALSE){
272                         
273                                 QuoteBreakPoint = i;
274                                 break;
275                         
276                         }
277                 
278                 }
280                 wxSPropertySeg1 = ContactLine.Mid(0, QuoteBreakPoint);
281                 wxSPropertySeg2 = ContactLine.Mid((QuoteBreakPoint + 1));
283                 wxStringTokenizer wxSPropertySegSplit(wxSPropertySeg1, wxT(";"));
284                 wxSProperty = wxSPropertySegSplit.GetNextToken();
285                         
286                 // Check what type of property it is.
287                 
288                 FoundData = FALSE;
289                 
290                 if ((wxSProperty == wxT("PHOTO") && PhotoFirst == FALSE) ||
291                 (wxSProperty == wxT("NICKNAME") && NicknameFirst == FALSE) || 
292                 (wxSProperty == wxT("TITLE") && TitleFirst == FALSE) || 
293                 (wxSProperty == wxT("FN") && FNFirst == FALSE) || 
294                 (wxSProperty == wxT("ORG") && OrganisationFirst == FALSE) ||
295                 (wxSProperty == wxT("NOTE") && NoteFirst == FALSE)){
296                         
297                         wxSPropertyVCARD4 = wxT("X-VCARD4-") + wxSProperty;
298                         intPrevValueSub = (wxSPropertyVCARD4.Len() + 2);
299                         
300                         for (std::map<int,wxString>::iterator itersub = ContactFileLines.begin(); 
301                         itersub != ContactFileLines.end(); ++itersub){
302                 
303                                 //DataLineProcess = DataLineProcessOriginal;
304                                 //DataLineSeek = DataLineSeekOrig;
305                 
306                                 ContactLineSub = itersub->second;
307                 
308                                 ExtraLineSeekSub = TRUE;
310                                 iterboolsub = ContactFileProcessed.find(itersub->first);
311                                 //std::map<int,bool>::iterator iterorig = ContactFileProcessed.find(itersub->first);
312                                 //std::map<int,bool>::iterator itersuborig;
313                 
314                                 // Ignore certain variables as they are not needed.
315                 
316                                 if (ContactLineSub == wxT("BEGIN:VCARD") || 
317                                 ContactLineSub == wxT("END:VCARD") || 
318                                 ContactLineSub.Mid(0, 8) == wxT("VERSION:") || 
319                                 ContactLineSub.Mid(0, 7) == wxT("PRODID:") || 
320                                 ContactLineSub.Mid(0, 5) == wxT("X-AIM") || 
321                                 ContactLineSub.Mid(0, 5) == wxT("X-MSN") || 
322                                 ContactLineSub.Mid(0, 5) == wxT("X-ICQ") || 
323                                 ContactLineSub.Mid(0, 10) == wxT("X-GADUGADU") || 
324                                 ContactLineSub.Mid(0, 7) == wxT("X-YAHOO") || 
325                                 ContactLineSub.Mid(0, 7) == wxT("X-SKYPE") || 
326                                 ContactLineSub.Mid(0, 8) == wxT("X-JABBER") ||
327                                 ContactLineSub.Mid(0, 4) == wxT("REV:")){
328                         
329                                         iterboolsub->second = TRUE;
330                                         continue;
331                         
332                                 }
333                 
334                                 if (iterboolsub->second == TRUE){
336                                         continue;
337                         
338                                 }
339                 
340                                 if (ContactLineSub.Mid(0, 1) == wxT(" ") || ContactLineSub.Mid(0, 1) == wxT("\t")){
341                 
342                                         continue;
343                 
344                                 }
345         
346                                 if (ContactLineSub.Mid(0, 4) == wxT("item")){
347                 
348                                         // Line is a itemn... so ignore.
349                 
350                                         continue;
351                 
352                                 }
353                 
354                                 //std::map<int,wxString>::iterator itersub = iter;
355                                 
356                                 DataLineProcess.insert(std::make_pair(DataLineSeek, itersub->first));
357                                 DataLineSeek++;
361                                 while (ExtraLineSeekSub == TRUE){
363                                         if (itersub == ContactFileLines.end()){
364                                                 ExtraLineSeekSub = FALSE;
365                                                 continue;
366                                         } else {
367                                                 itersub++;
369                                         }
371                                         iterboolsub = ContactFileProcessedWorking.find(itersub->first);
373                                         wxSPropertyNextLine = itersub->second;
375                                         if (wxSPropertyNextLine.Mid(0, 1) == wxT(" ") || wxSPropertyNextLine.Mid(0, 1) == wxT("\t")){
377                                                 wxSPropertyNextLine.Remove(0, 1);
378                                                 //wxSPropertyNextLine.Trim(FALSE);
379                                                 //ContactLine.Trim();
380                                                 ContactLineSub.Append(wxSPropertyNextLine);
381                                                 //iterboolsub->second = TRUE;
382                                                 DataLineProcess.insert(std::make_pair(DataLineSeek, itersub->first));
383                                                 DataLineSeek++;
385                                         } else {
387                                                 itersub--;
388                                                 ExtraLineSeekSub = FALSE;
390                                         }
392                                 }
394                                 /*while (ExtraLineSeekSub == TRUE && iterboolsub != ContactFileProcessedWorking.end()){
395                 
396                                         // Check if there is extra data on the next line 
397                                         // (indicated by space or tab at the start) and add data.
398                 
399                                         itersub++;
401                                         iterboolsub = ContactFileProcessedWorking.find(itersub->first);
402                         
403                                         if (iterboolsub->second == TRUE){
404                         
405                                                 continue;
406                         
407                                         }
408                         
409                                         if (itersub == ContactFileLines.end()){
410                         
411                                                 break;
412                         
413                                         }                       
414                 
415                                         wxSPropertyNextLine = itersub->second;
416                 
417                                         if (wxSPropertyNextLine.Mid(0, 1) == wxT(" ") || wxSPropertyNextLine.Mid(0, 1) == wxT("\t")){
418                 
419                                                 wxSPropertyNextLine.Remove(0, 1);
420                                                 //wxSPropertyNextLine.Trim(FALSE);
421                                                 //ContactLine.Trim();
422                                                 ContactLineSub.Append(wxSPropertyNextLine);
423                                                 //iterboolsub->second = TRUE;
424                                                 DataLineProcess.insert(std::make_pair(DataLineSeek, itersub->first));
425                                                 DataLineSeek++;
426                 
427                                         } else {
428                         
429                                                 itersub--;
430                                                 ExtraLineSeekSub = FALSE;
431                         
432                                         }
434                                         if (iterboolsub == ContactFileProcessedWorking.end()){
436                                                 break;
437                                                 ExtraLineSeekSub = FALSE;
439                                         }
440                 
441                                 }*/
442                 
443                                 ContactLineSubLen = ContactLineSub.Len();
444                                 PropertyFind = TRUE;
445                                 wxSPropertySub.clear();
446                         
447                                 for (int i = 0; i <= ContactLineSubLen; i++){
448                 
449                                         if ((ContactLineSub.Mid(i, 1) == wxT(";") || ContactLineSub.Mid(i, 1) == wxT(":")) && PropertyFind == TRUE){
450                         
451                                                 PropertyFind = FALSE;
452                         
453                                         } else if (PropertyFind == TRUE){
454                         
455                                                 wxSPropertySub.Append(ContactLineSub.Mid(i, 1));
456                         
457                                         }               
458                 
459                                         if (ContactLineSub.Mid(i, 1) == wxT("\"")){
460                         
461                                                 if (QuoteMode == TRUE){
462                                  
463                                                         QuoteMode = FALSE;
464                                 
465                                                 } else {
466                         
467                                                         QuoteMode = TRUE;
468                                         
469                                                 }
470                         
471                                         }
472                         
473                                         if (ContactLineSub.Mid(i, 1) == wxT(":") && ContactLineSub.Mid((i - 1), 1) != wxT("\\") && QuoteMode == FALSE){
474                         
475                                                 QuoteBreakPoint = i;
476                                                 break;
477                         
478                                         }
479                 
480                                 }
482                                 if (wxSPropertySub != wxSPropertyVCARD4){
483                         
484                                         wxSPropertySub.clear();
485                                         DataLineSeek = 0;
486                                         DataLineProcess.clear();
487                                         continue;
488                         
489                                 }
491                                 wxSPropertySeg1Sub = ContactLineSub.Mid(0, QuoteBreakPoint);
492                                 wxSPropertySeg2Sub = ContactLineSub.Mid((QuoteBreakPoint + 1));
494                                 // Split the property name data.
495                         
496                                 // Strip the X-VCARD4- from the variable.
497                                 
498                                 wxString wxSPropertyChopped =  wxSPropertySeg1Sub.Mid(9);
499                         
500                                 intPrevValueSub = (wxSProperty.Len() + 2);
501                                 
502                                 SplitValuesData(&wxSPropertyChopped, &TempSplitPoints, &TempSplitLength, (int)intPrevValueSub, &TempPropertyData);
503                                 
504                                 // Process the splitted data into temporary property data.
506                                 // Look for certain property names and the X-FIRST
507                                 // property name.
508                                         
509                                 bool ProcessData = FALSE;
510                         
511                                 // Check for X-FIRST.
512                         
513                                 for (std::map<wxString, wxString>::iterator xfiter = TempPropertyData.begin(); 
514                                 xfiter != TempPropertyData.end(); ++xfiter){
515                         
516                                         PropertyName = xfiter->first;
517                                         PropertyValue = xfiter->second;
518                                                 
519                                         if (PropertyName == wxT("X-FIRST") && PropertyValue == wxT("TRUE")){
520                                 
521                                                 ProcessData = TRUE;
522                                                 
523                                                 if (wxSProperty == wxT("PHOTO")){ PhotoFirst = TRUE; }
524                                                 else if (wxSProperty == wxT("NICKNAME")){ NicknameFirst = TRUE; }
525                                                 else if (wxSProperty == wxT("TITLE")){ TitleFirst = TRUE; }
526                                                 else if (wxSProperty == wxT("FN")){ FNFirst = TRUE; }
527                                                 else if (wxSProperty == wxT("ORG")){ OrganisationFirst = TRUE; }
528                                                 else if (wxSProperty == wxT("NOTE")){ NoteFirst = TRUE; }
529                                                 break;
530                                 
531                                         }
532                         
533                                 }
534                         
535                                 if (ProcessData == FALSE){
536                         
537                                         DataLineProcess.clear();
538                                         DataLineSeek = 0;
539                                         TempPropertyData.clear();
540                         
541                                 } else {
542                                 
543                                         wxT("PHOTODANCEMATCH!");
544                         
545                                         for (std::map<wxString, wxString>::iterator xfiter = TempPropertyData.begin(); 
546                                         xfiter != TempPropertyData.end(); ++xfiter){
547                         
548                                                 PropertyName = xfiter->first;
549                                                 PropertyValue = xfiter->second;
550                         
551                                                 if (PropertyName == wxT("X-FIRST")){
552                                 
553                                                         continue;
554                                 
555                                                 }
556                                 
557                                                 PropertyData.insert(std::make_pair(PropertyName, PropertyValue));
558                                                 PropertyLock.insert(std::make_pair(PropertyName, FALSE));
559                         
560                                         }
561                                 
562                                         // Mark all lines as processed.
563                                         
564                                         for (std::map<int,int>::iterator dpiter = DataLineProcess.begin(); 
565                                         dpiter != DataLineProcess.end(); ++dpiter){
566                                         
567                                                 DLSLiter = ContactFileProcessed.find(dpiter->second);
568                                                 DLSLiter->second = TRUE;
569                                         
570                                         }
571                                         
572                                         for (std::map<int,int>::iterator dpoiter = DataLineProcessOriginal.begin(); 
573                                         dpoiter != DataLineProcessOriginal.end(); ++dpoiter){
574                                         
575                                                 DLSLiter = ContactFileProcessed.find(dpoiter->second);
576                                                 DLSLiter->second = TRUE;
577                                         
578                                         }
579                                         
580                                         DataLineProcess.clear();
581                                         DataLineProcessOriginal.clear();
582                                         DataLineSeek = 0;
583                                         DataLineSeekOrig = 0;
584                                         TempSplitPoints.clear();
585                                         TempSplitLength.clear();
586                                         TempPropertyData.clear();
587                                         FoundData = TRUE;
588                                         
589                                         break;
590                         
591                                 }
592                                 
593                         }
594                 
595                 } else {
596                 
597                         wxSProperty.clear();
598                         wxSPropertySub.Clear();
599                         wxSPropertySeg1.Clear();
600                         wxSPropertySeg2.Clear();
601                         wxSPropertySeg1Sub.Clear();
602                         wxSPropertySeg2Sub.Clear();
603                         wxSPropertyValues.Clear();
604                         wxSPropertyData.Clear();
605                         wxSPropertyXVCard4Value.Clear();
606                         wxSPropertyNameConv.Clear();
607                         PropertyData.clear();
608                         PropertyLock.clear();
609                         ContactLine.clear();
610                         ContactLineSub.clear();
611                         DataLineProcess.clear();
612                         DataLineProcessOriginal.clear();
613                         TempSplitPoints.clear();
614                         TempSplitLength.clear();
615                         wxSPropertyVCARD4.clear();
616                         DataLineSeek = 0;
617                         DataLineSeekOrig = 0;
618                         XVCard4Value = FALSE;
619                         VCard3Value = FALSE;
620                 
621                 }
622                 
623                 if (FoundData == FALSE){
624                 
625                         wxSProperty.clear();
626                         wxSPropertySub.Clear();
627                         wxSPropertySeg1.Clear();
628                         wxSPropertySeg2.Clear();
629                         wxSPropertySeg1Sub.Clear();
630                         wxSPropertySeg2Sub.Clear();
631                         wxSPropertyValues.Clear();
632                         wxSPropertyData.Clear();
633                         wxSPropertyXVCard4Value.Clear();
634                         wxSPropertyNameConv.Clear();
635                         PropertyData.clear();
636                         PropertyLock.clear();
637                         ContactLine.clear();
638                         ContactLineSub.clear();
639                         DataLineProcess.clear();
640                         DataLineProcessOriginal.clear();
641                         TempSplitPoints.clear();
642                         TempSplitLength.clear();
643                         wxSPropertyVCARD4.clear();
644                         DataLineSeek = 0;
645                         DataLineSeekOrig = 0;
646                         XVCard4Value = FALSE;
647                         VCard3Value = FALSE;
648                 
649                 }
650                 
651                 ConvertV4PropertyProc(&wxSProperty, &wxSPropertySeg1, &wxSPropertySeg2, 
652                         &wxSPropertyValues, &wxSPropertyData, &wxSPropertyXVCard4Value, 
653                         &wxSPropertyNameConv, &PropertyData, &PropertyLock, FALSE, &VCard3Value, &XVCard4Value);
654                 
655                 wxString FinalPropertyData;
656         
657                 FinalPropertyData.Append(wxSPropertyNameConv);
658         
659                 for (std::map<wxString, wxString>::iterator striter = PropertyData.begin(); 
660                 striter != PropertyData.end(); ++striter){
662                         FinalPropertyData.Append(wxT(";"));             
663                         FinalPropertyData.Append(striter->first);
664                         FinalPropertyData.Append(wxT("="));
665                         FinalPropertyData.Append(striter->second);
666                 
667                 }
668                 
669                 wxString FinalPropValue;
670                 
671                 if (wxSPropertyXVCard4Value.IsEmpty()){
672                 
673                         FinalPropValue = wxSPropertyData;
674                 
675                 } else {
676                 
677                         if (wxSPropertyXVCard4Value != wxSPropertyData){
678                 
679                                 FinalPropValue = wxSPropertyXVCard4Value;
680                         
681                         }
682                 
683                 }
684                         
685                 if (FinalPropertyData.IsEmpty() && FinalPropValue.IsEmpty()){
686                 
687                         continue;
688                 
689                 }
690                 
691                 vCardOut->AddRaw(FinalPropertyData, FinalPropValue);
693                 wxSProperty.clear();
694                 wxSPropertySub.Clear();
695                 wxSPropertySeg1.Clear();
696                 wxSPropertySeg2.Clear();
697                 wxSPropertySeg1Sub.Clear();
698                 wxSPropertySeg2Sub.Clear();
699                 wxSPropertyValues.Clear();
700                 wxSPropertyData.Clear();
701                 wxSPropertyXVCard4Value.Clear();
702                 wxSPropertyNameConv.Clear();
703                 //FinalPropertyData.clear();
704                 //FinalPropValue.clear();
705                 PropertyData.clear();
706                 PropertyLock.clear();
707                 ContactLine.clear();
708                 ContactLineSub.clear();
709                 DataLineProcess.clear();
710                 DataLineProcessOriginal.clear();
711                 wxSPropertyVCARD4.clear();
712                 DataLineSeek = 0;
713                 DataLineSeekOrig = 0;
714                 XVCard4Value = FALSE;
715                 VCard3Value = FALSE;
716         
717         }
718         
719         // Process the non-itemn values.
720         
721         for (std::map<int,wxString>::iterator iter = ContactFileLines.begin(); 
722          iter != ContactFileLines.end(); ++iter){
723         
724                 ExtraLineSeek = TRUE;
726                 iterbool = ContactFileProcessed.find(iter->first);
727                 
728                 ContactLine = iter->second;
729                 
730                 // Ignore certain variables as they are not needed.
731                 
732                 if (ContactLine == wxT("BEGIN:VCARD") || 
733                 ContactLine == wxT("END:VCARD") || 
734                 ContactLine.Mid(0, 8) == wxT("VERSION:") || 
735                 ContactLine.Mid(0, 7) == wxT("PRODID:") || 
736                 ContactLine.Mid(0, 5) == wxT("X-AIM") || 
737                 ContactLine.Mid(0, 5) == wxT("X-MSN") || 
738                 ContactLine.Mid(0, 5) == wxT("X-ICQ") || 
739                 ContactLine.Mid(0, 10) == wxT("X-GADUGADU") || 
740                 ContactLine.Mid(0, 7) == wxT("X-YAHOO") || 
741                 ContactLine.Mid(0, 7) == wxT("X-SKYPE") || 
742                 ContactLine.Mid(0, 8) == wxT("X-JABBER") ||
743                 ContactLine.Mid(0, 4) == wxT("REV:")){
744                         
745                         iterbool->second = TRUE;
746                         continue;
747                         
748                 }
749                 
750                 if (iterbool->second == TRUE){
751                         
752                         continue;
753                         
754                 }
755                 
756                 if (ContactLine.Mid(0, 1) == wxT(" ") || ContactLine.Mid(0, 1) == wxT("\t")){
757                 
758                         continue;
759                 
760                 }
761         
762                 if (ContactLine.Mid(0, 4) == wxT("item")){
763                 
764                         // Line is a itemn... so ignore.
765                 
766                         continue;
767                 
768                 }
769                 
770                 std::map<int,wxString>::iterator itersub = iter;
772                 while (ExtraLineSeek == TRUE){
773                 
774                         // Check if there is extra data on the next line 
775                         // (indicated by space or tab at the start) and add data.
777                         if (itersub == ContactFileLines.end()){
778                                 ExtraLineSeekSub = FALSE;
779                                 continue;
780                         }
781                         else {
782                                 itersub++;
784                         }
786                         iterboolsub = ContactFileProcessedWorking.find(itersub->first);
788                         if (iterboolsub == ContactFileProcessedWorking.end()){
789                         
790                                 break;
791                         
792                         }
793                         
794                         if (iterboolsub->second == TRUE){
795                         
796                                 continue;
797                         
798                         }
799                         
800                         if (itersub == ContactFileLines.end()){
801                         
802                                 break;
803                         
804                         }                       
805                 
806                         wxSPropertyNextLine = itersub->second;
807                 
808                         if (wxSPropertyNextLine.Mid(0, 1) == wxT(" ") || wxSPropertyNextLine.Mid(0, 1) == wxT("\t")){
809                 
810                                 wxSPropertyNextLine.Remove(0, 1);
811                                 //wxSPropertyNextLine.Trim(FALSE);
812                                 //ContactLine.Trim();
813                                 ContactLine.Append(wxSPropertyNextLine);
814                                 iterboolsub->second = TRUE;
815                 
816                         } else {
817                         
818                                 ExtraLineSeek = FALSE;
819                         
820                         }
821                 
822                 }
823                 
824                 ContactLineLen = ContactLine.Len();
825                 
826                 for (int i = 0; i <= ContactLineLen; i++){
827                 
828                         if ((ContactLine.Mid(i, 1) == wxT(";") || ContactLine.Mid(i, 1) == wxT(":")) && PropertyFind == TRUE){
829                         
830                                 PropertyFind = FALSE;
831                         
832                         } else if (PropertyFind == TRUE){
833                         
834                                 wxSProperty.Append(ContactLine.Mid(i, 1));
835                         
836                         }               
837                 
838                         if (ContactLine.Mid(i, 1) == wxT("\"")){
839                         
840                                 if (QuoteMode == TRUE){
841                                 
842                                         QuoteMode = FALSE;
843                                 
844                                 } else {
845                         
846                                         QuoteMode = TRUE;
847                                         
848                                 }
849                         
850                         }
851                         
852                         if (ContactLine.Mid(i, 1) == wxT(":") && ContactLine.Mid((i - 1), 1) != wxT("\\") && QuoteMode == FALSE){
853                         
854                                 QuoteBreakPoint = i;
855                                 break;
856                         
857                         }
858                 
859                 }
861                 wxSPropertySeg1 = ContactLine.Mid(0, QuoteBreakPoint);
862                 wxSPropertySeg2 = ContactLine.Mid((QuoteBreakPoint + 1));
864                 wxStringTokenizer wxSPropertySegSplit(wxSPropertySeg1, wxT(";"));
865                 wxSProperty = wxSPropertySegSplit.GetNextToken();
867                 std::map<int,int> DataLineProcess;
868                 std::map<int, bool>::iterator DLSLiter;
869                 
870                 // Look for the X-VCARD4-(variablename) equivilant.
871                 
872                 wxSPropertyVCARD4 = wxT("X-VCARD4-") + wxSProperty;
873                         
874                 // Sort out remainder of the types.
875                 
876                 ConvertV4PropertyProc(&wxSProperty, &wxSPropertySeg1, &wxSPropertySeg2, 
877                         &wxSPropertyValues, &wxSPropertyData, &wxSPropertyXVCard4Value, 
878                         &wxSPropertyNameConv, &PropertyData, &PropertyLock, FALSE, &VCard3Value, &XVCard4Value);
879                 
880                 wxString FinalPropertyData;
881         
882                 FinalPropertyData.Append(wxSPropertyNameConv);
883         
884                 for (std::map<wxString, wxString>::iterator striter = PropertyData.begin(); 
885                 striter != PropertyData.end(); ++striter){
887                         FinalPropertyData.Append(wxT(";"));             
888                         FinalPropertyData.Append(striter->first);
889                         FinalPropertyData.Append(wxT("="));
890                         FinalPropertyData.Append(striter->second);
891                 
892                 }
893                 
894                 wxString FinalPropValue;
895                 
896                 if (wxSPropertyXVCard4Value.IsEmpty()){
897                 
898                         FinalPropValue = wxSPropertyData;
899                 
900                 } else {
901                 
902                         if (wxSPropertyXVCard4Value != wxSPropertyData){
903                 
904                                 FinalPropValue = wxSPropertyXVCard4Value;
905                         
906                         }
907                 
908                 }
909                 
910                 vCardOut->AddRaw(FinalPropertyData, FinalPropValue);
912                 wxSProperty.clear();
913                 wxSPropertySub.Clear();
914                 wxSPropertySeg1.Clear();
915                 wxSPropertySeg2.Clear();
916                 wxSPropertyValues.Clear();
917                 wxSPropertyData.Clear();
918                 wxSPropertyXVCard4Value.Clear();
919                 wxSPropertyNameConv.Clear();
920                 //FinalPropertyData.clear();
921                 //FinalPropValue.clear();
922                 PropertyData.clear();
923                 PropertyLock.clear();
924                 ContactLine.clear();
925                 XVCard4Value = FALSE;
926                 VCard3Value = FALSE;
927         
928         }
929         
930         int FNCount = 0;
931         int NameCount = 0;
932         int NicknameCount = 0;
933         int ADRCount = 0;
934         int EmailCount = 0;
935         int IMPPCount = 0;
936         int TelCount = 0;
937         int LangCount = 0;
938         int TZCount = 0;
939         int GeoCount = 0;
940         int URLCount = 0;
941         int RelatedCount = 0;
942         int TitleCount = 0;
943         int RoleCount = 0;
944         int OrgCount = 0;
945         int NoteCount = 0;
946         int CategoryCount = 0;
947         int PhotoCount = 0;
948         int LogoCount = 0;
949         int SoundCount = 0;
950         int CalAdrCount = 0;
951         int CalReqAdrCount = 0;
952         int FreeBusyCount = 0;
953         int KeyCount = 0;
954         int VendorCount = 0;
955         int XTokenCount = 0;
956         int ItemSeek = 1;
957         int MaxItemNumber = 0;
958         int ItemOrdered = 0;
959         int ItemUnordered = 0;
960         int ItemNumber = 0;
961         size_t ItemStringSeekLen = 0;
962         int ItemSeekSub = 0;
963         int ItemSeekSecSub = 0;
964         //int intValueSeek = 1;
965         
966         std::map<int, wxString> NumberedName;
967         std::map<int, wxString> NumberedData;
968         std::map<int, wxString> NumberedPropValues;
969         std::map<int, wxString> NumberedPropOldValue;
970         
971         std::map<int, wxString> UnNumberedName;
972         std::map<int, wxString> UnNumberedData;
973         std::map<int, wxString> UnNumberedPropValues;
974         std::map<int, wxString> UnNumberedPropOldValue;
976         // Part 1: Get the itemn number.
977         
978         std::map<int,bool>::iterator iterboolsecsub;
979         std::map<int,wxString>::iterator itersub;
980         std::map<int, wxString> TempData;
981         PropertyData.clear();
982         PropertyLock.clear();
983         wxString ItemString;
984         wxString ItemStringSeek;
985         wxString ItemPropName;
986         ContactLineSeek = 0;
987         
988         ContactLineSub.clear();
989         ExtraLineSeekSub = 0;
990         wxString wxSPropertyNextLineSub;
991         ContactLineSubLen = 0;
992         int ItemIndex = 0;
993         PropertFindSub.clear();
994         wxSPropertySub.clear();
995         wxSPropertySeg1Sub.clear();
996         wxSPropertySeg2Sub.clear();
997         wxSPropertyValues.clear();
998         wxSPropertyData.clear();
999         wxSPropertyNameConv.clear();
1000         wxSPropertyXVCard4Value.clear();
1001         ItemProcString.clear();
1002         
1003         XVCard4Value = FALSE;
1004         VCard3Value = FALSE;
1005         SeekItemData = FALSE;
1006         
1007         std::map<wxString, void*> ItemMapIndex;
1008         //std::map<wxString, wxString> ItemNameIndex;
1009         
1010         // Look for item in the initial line, process into a proper line then
1011         // look for other lines with the same item association.
1012         
1013         for (std::map<int,wxString>::iterator iter = ContactFileLines.begin();
1014                 iter != ContactFileLines.end(); ++iter){
1015         
1016                 ExtraLineSeek = TRUE;
1017                 
1018                 iterbool = ContactFileProcessed.find(iter->first);
1019                 
1020                 if (iterbool->second == TRUE){
1021                 
1022                         continue;
1023                 
1024                 }
1025                 
1026                 ContactLine = iter->second;
1027                 
1028                 if (ContactLine.Mid(0, 1) == wxT(" ") || ContactLine.Mid(0, 1) == wxT("\t")){
1029                 
1030                         continue;
1031                 
1032                 }
1033                 
1034                 if (ContactLine.Mid(0, 4) != wxT("item")){
1035                 
1036                         continue;
1037                 
1038                 }
1039                 
1040                 // Get Item data.
1042                 //ContactLineSeekSub = ContactLineSeek;
1043                 std::map<int,wxString>::iterator itersub = iter;
1045                 while (ExtraLineSeek == TRUE){
1046                 
1047                         // Check if there is extra data on the next line 
1048                         // (indicated by space or tab at the start) and add data.
1049                 
1050                         itersub++;
1051                         iterboolsub = ContactFileProcessed.find(itersub->first);
1053                         if (iterboolsub == ContactFileProcessed.end()){
1054                         
1055                                 break;
1056                         
1057                         }
1058                         
1059                         if (iterboolsub->second == TRUE){
1060                         
1061                                 continue;
1062                         
1063                         }
1064                         
1065                         if (itersub == ContactFileLines.end()){
1066                         
1067                                 break;
1068                         
1069                         }                       
1070                 
1071                         wxSPropertyNextLine = itersub->second;
1072                 
1073                         if (wxSPropertyNextLine.Mid(0, 1) == wxT(" ") || wxSPropertyNextLine.Mid(0, 1) == wxT("\t")){
1074                 
1075                                 wxSPropertyNextLine.Remove(0, 1);
1076                                 //wxSPropertyNextLine.Trim(FALSE);
1077                                 //ContactLine.Trim();
1078                                 ContactLine.Append(wxSPropertyNextLine);
1079                                 iterboolsub->second = TRUE;
1080                 
1081                         } else {
1082                         
1083                                 ExtraLineSeek = FALSE;
1084                         
1085                         }
1086                 
1087                 }
1088                 
1089                 ContactLineLen = ContactLine.Len();
1090                 
1091                 for (int i = 0; i <= ContactLineLen; i++){
1092                 
1093                         if ((ContactLine.Mid(i, 1) == wxT(";") || ContactLine.Mid(i, 1) == wxT(":")) && PropertyFind == TRUE){
1094                         
1095                                 PropertyFind = FALSE;
1096                         
1097                         } else if (PropertyFind == TRUE){
1098                         
1099                                 wxSProperty.Append(ContactLine.Mid(i, 1));
1100                         
1101                         }               
1102                 
1103                         if (ContactLine.Mid(i, 1) == wxT("\"")){
1104                         
1105                                 if (QuoteMode == TRUE){
1106                                 
1107                                         QuoteMode = FALSE;
1108                                 
1109                                 } else {
1110                         
1111                                         QuoteMode = TRUE;
1112                                         
1113                                 }
1114                         
1115                         }
1116                         
1117                         if (ContactLine.Mid(i, 1) == wxT(":") && ContactLine.Mid((i - 1), 1) != wxT("\\") && QuoteMode == FALSE){
1118                         
1119                                 QuoteBreakPoint = i;
1120                                 break;
1121                         
1122                         }
1123                 
1124                 }
1126                 wxSPropertySeg1 = ContactLine.Mid(0, QuoteBreakPoint);
1127                 wxSPropertySeg2 = ContactLine.Mid((QuoteBreakPoint + 1));
1128                 
1129                 // Go through the lines and collect the lines like itemn.
1130                 
1131                 std::map<int,wxString> *ItemListData;
1132                 ItemListData = new std::map<int,wxString>;
1133                 
1134                 wxStringTokenizer ItemData(wxSPropertySeg1, wxT("."));
1135                 
1136                 ItemString = ItemData.GetNextToken();
1137                 ItemStringSeek = wxT("item") + ItemString.Mid(4);
1138                 
1139                 wxStringTokenizer ItemPropSplit(ItemData.GetNextToken(), wxT(";"));
1140                 
1141                 ItemPropName = ItemPropSplit.GetNextToken();
1142                 
1143                 ItemStringSeekLen = ItemStringSeek.Len();
1144                 
1145                 ItemIndex = 0;
1146                 
1147                 for (std::map<int,wxString>::iterator itersec = ContactFileLines.begin();
1148                 itersec != ContactFileLines.end(); ++itersec){
1149                 
1150                         ExtraLineSeek = TRUE;
1151                 
1152                         iterboolsub = ContactFileProcessed.find(itersec->first);
1153                 
1154                         if (iterboolsub->second == TRUE){
1155                         
1156                                 continue;
1157                         
1158                         }
1159                 
1160                         ContactLineSub = itersec->second;
1161                         
1162                         wxStringTokenizer ItemProcData(ContactLineSub, wxT("."));
1163                         ItemProcString = ItemData.GetNextToken();
1164                         
1165                         if (ItemStringSeek != ContactLineSub.Mid(0, ItemStringSeekLen)){
1166                         
1167                                 continue;
1168                         
1169                         }
1170                         
1171                         ItemIndex++;
1172                         
1173                         ItemListData->insert(std::make_pair(ItemIndex, ContactLineSub));
1174                         
1175                         iterboolsub->second = TRUE;
1176                 
1177                 }
1178                 
1179                 //ItemNameIndex.insert(std::make_pair(ItemStringSeek, ItemPropName));
1180                 ItemListData->insert(std::make_pair(ItemIndex, ContactLineSub));
1181                 ItemMapIndex.insert(std::make_pair(ItemStringSeek, ItemListData));
1182                 
1183         }
1184         
1185         // Process each itemn set.
1186         
1187         for (std::map<wxString, void*>::iterator iter = ItemMapIndex.begin();
1188                 iter != ItemMapIndex.end(); ++iter){
1189                         
1190                 std::map<int, wxString> *ItemDataPtr;
1192                 ItemDataPtr = (std::map<int,wxString>*)iter->second;
1193                 
1194                 for (std::map<int,wxString>::iterator itersub = ItemDataPtr->begin();
1195                         itersub != ItemDataPtr->end(); ++itersub){
1196                         
1197                         ContactLine = itersub->second;
1198                         
1199                         ContactLineLen = ContactLine.Len();
1200                 
1201                         for (int i = 0; i <= ContactLineLen; i++){
1202                 
1203                                 if ((ContactLine.Mid(i, 1) == wxT(";") || ContactLine.Mid(i, 1) == wxT(":")) && PropertyFind == TRUE){
1204                         
1205                                         PropertyFind = FALSE;
1206                         
1207                                 } else if (PropertyFind == TRUE){
1208                         
1209                                         wxSProperty.Append(ContactLine.Mid(i, 1));
1210                         
1211                                 }               
1212                 
1213                                 if (ContactLine.Mid(i, 1) == wxT("\"")){
1214                         
1215                                         if (QuoteMode == TRUE){
1216                                 
1217                                                 QuoteMode = FALSE;
1218                                 
1219                                         } else {
1220                         
1221                                                 QuoteMode = TRUE;
1222                                         
1223                                         }
1224                         
1225                                 }
1226                         
1227                                 if (ContactLine.Mid(i, 1) == wxT(":") && ContactLine.Mid((i - 1), 1) != wxT("\\") && QuoteMode == FALSE){
1228                         
1229                                         QuoteBreakPoint = i;
1230                                         break;
1231                         
1232                                 }
1233                 
1234                         }
1235                         
1236                         wxSPropertySeg1Sub = ContactLine.Mid(0, QuoteBreakPoint);
1237                         wxSPropertySeg2Sub = ContactLine.Mid((QuoteBreakPoint + 1));
1238                         
1239                         wxStringTokenizer wxSPropertySegSplit(wxSPropertySeg1Sub, wxT(";"));
1240                         wxSProperty = wxSPropertySegSplit.GetNextToken();
1241                         
1242                         // Sort out remainder of the types.
1243                         
1244                         // Skip certain X-* IM variables as they are processed via
1245                         // IMPP.
1246                         
1247                         if (wxSProperty == wxT("X-AIM") || wxSProperty == wxT("X-MSN") || 
1248                         wxSProperty == wxT("X-ICQ") || wxSProperty == wxT("X-GADUGADU") || 
1249                         wxSProperty == wxT("X-YAHOO") || wxSProperty == wxT("X-SKYPE") || 
1250                         wxSProperty == wxT("X-JABBER")){
1251                 
1252                                 wxSProperty.clear();
1253                                 wxSPropertySub.Clear();
1254                                 wxSPropertySeg1.Clear();
1255                                 wxSPropertySeg2.Clear();
1256                                 wxSPropertyValues.Clear();
1257                                 wxSPropertyData.Clear();
1258                                 wxSPropertyXVCard4Value.Clear();
1259                                 wxSPropertyNameConv.Clear();
1260                                 //FinalPropertyData.clear();
1261                                 //FinalPropValue.clear();
1262                                 PropertyData.clear();
1263                                 PropertyLock.clear();
1264                                 ContactLine.clear();
1265                                 XVCard4Value = FALSE;
1266                                 VCard3Value = FALSE;
1267                                 continue;
1268                 
1269                         }
1270                         
1271                         ConvertV4PropertyProc(&wxSProperty, &wxSPropertySeg1Sub, &wxSPropertySeg2Sub, 
1272                         &wxSPropertyValues, &wxSPropertyData, &wxSPropertyXVCard4Value, 
1273                         &wxSPropertyNameConv, &PropertyData, &PropertyLock, TRUE, &VCard3Value, &XVCard4Value);
1274                         
1275                 }
1276                 
1277                 if (wxSPropertyNameConv.IsEmpty()){
1278                 
1279                         wxSProperty.clear();
1280                         wxSPropertySub.Clear();
1281                         wxSPropertySeg1.Clear();
1282                         wxSPropertySeg2.Clear();
1283                         wxSPropertyValues.Clear();
1284                         wxSPropertyData.Clear();
1285                         wxSPropertyXVCard4Value.Clear();
1286                         wxSPropertyNameConv.Clear();
1287                         //FinalPropertyData.clear();
1288                         //FinalPropValue.clear();
1289                         PropertyData.clear();
1290                         PropertyLock.clear();
1291                         ContactLine.clear();
1292                         XVCard4Value = FALSE;
1293                         VCard3Value = FALSE;
1294                         continue;
1295                 
1296                 }
1297                 
1298                 wxString FinalPropertyData;
1299         
1300                 FinalPropertyData.Append(wxSPropertyNameConv);
1301         
1302                 for (std::map<wxString, wxString>::iterator striter = PropertyData.begin(); 
1303                 striter != PropertyData.end(); ++striter){
1305                         FinalPropertyData.Append(wxT(";"));             
1306                         FinalPropertyData.Append(striter->first);
1307                         FinalPropertyData.Append(wxT("="));
1308                         FinalPropertyData.Append(striter->second);
1309                 
1310                 }
1311                 
1312                 wxString FinalPropValue;
1313                 
1314                 if (wxSPropertyXVCard4Value.IsEmpty()){
1315                 
1316                         FinalPropValue = wxSPropertyData;
1317                 
1318                 } else {
1319                 
1320                         if (wxSPropertyXVCard4Value != wxSPropertyData){
1321                         
1322                                 FinalPropValue = wxSPropertyData;
1323                                 
1324                         } else {
1325                 
1326                                 FinalPropValue = wxSPropertyXVCard4Value;
1327                 
1328                         }
1329                 
1330                 }
1331                 
1332                 vCardOut->AddRaw(FinalPropertyData, FinalPropValue);
1333                 
1334                 wxSProperty.clear();
1335                 wxSPropertySub.Clear();
1336                 wxSPropertySeg1Sub.Clear();
1337                 wxSPropertySeg2Sub.Clear();
1338                 wxSPropertyValues.Clear();
1339                 wxSPropertyData.Clear();
1340                 wxSPropertyXVCard4Value.Clear();
1341                 wxSPropertyNameConv.Clear();
1342                 FinalPropertyData.clear();
1343                 FinalPropValue.clear();
1344                 PropertyData.clear();
1345                 PropertyLock.clear();
1346                 ContactLine.clear();
1347                 XVCard4Value = FALSE;
1348                 VCard3Value = FALSE;
1349         
1350                 TempData.clear();
1351                 //PropertyData.clear();
1352                 //PropertyLock.clear();
1353                 
1354         }
1355         
1356         // Delete data.
1357         
1358         std::map<int, wxString> *ItemEraseData;
1359         
1360         for (std::map<wxString, void*>::iterator iter = ItemMapIndex.begin();
1361                 iter != ItemMapIndex.end(); ++iter){
1362                 
1363                 ItemEraseData = (std::map<int,wxString>*)iter->second;
1365                 delete ItemEraseData;
1366                 ItemEraseData = NULL;
1367                 
1368         }
1370         ItemMapIndex.clear();
1371         
1372         vCardOut->AddRaw(wxT("END"), wxT("VCARD"));
1374         return TRUE;
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