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