Home | News | Projects | Releases
Bugs | RFE | Repositories | Help
Initial import of code already done for Xestia Address Book
[xestiaab/.git] / source / vcard / vcard34conv.cpp
1 #include "vcard34conv.h"
2 #include "vcard.h"
3 #include "../version.h"
4 #include "../common/textprocessing.h"
5 #include <wx/file.h>
6 #include <cmath>
7 #include <map>
9 #include <wx/ffile.h>
10 #include <wx/tokenzr.h>
11 #include <wx/datetime.h>
12 #include <wx/wx.h>
14 // vcard.cpp - Deals with vCard 4.0 formatted files meeting the
15 // RFC 6350 specification.
17 vCard34Conv::vCard34Conv(){
18     vCardBegin = FALSE;
19     vCardEnd = FALSE;
20     vCardFN = FALSE;
21     vCardVersion = 0.0;
22     SettingCount = 0;
23 }
25 bool vCard34Conv::ConvertToV3(wxString Filename, wxString *wxSData){
27         wxString V3Data;
28         wxString V4Data;
29         
30         // Load the contact into the contact editor.
31         
32         wxFFile ContactFile;
33         wxString wxSContactString;
34         wxString ContactLine;
35         vCard ContactData;
37         vCard ContactDatav3;
38         
39         //wxSContactFilename = Filename;
40         
41         // Check if we are using wxWidgets version 2.8 or less and
42         // execute the required command accordingly.
43         
44 #if wxABI_VERSION < 20900
45         ContactFile.Open(Filename.c_str(), wxT("r"));
46 #else
47         ContactFile.Open(Filename, wxT("r"));
48 #endif  
49         
50         if (ContactFile.IsOpened() == FALSE){
52                 return FALSE;
53         
54         }
55         
56         ContactFile.ReadAll(&wxSContactString, wxConvAuto());
57         
58         // Split the lines.
59         
60         std::map<int, wxString> ContactFileLines;
61         std::map<int, wxString>::iterator striter;
62         
63         wxStringTokenizer wSTContactFileLines(wxSContactString, wxT("\r\n"));
65         int ContactLineSeek = 0;
67         while (wSTContactFileLines.HasMoreTokens() == TRUE){
69                 ContactLine = wSTContactFileLines.GetNextToken();
70                 ContactFileLines.insert(std::make_pair(ContactLineSeek, ContactLine));
71                 ContactLineSeek++;              
72         
73         }
75         // Get the line.
77         bool QuoteMode = FALSE;
78         bool PropertyFind = TRUE;
79         bool HasExtraNicknames = FALSE;
80         bool IgnoreGender = FALSE;
81         bool ExtraLineSeek = TRUE;
82         bool BirthdayProcessed = FALSE;
83         bool AnniversaryProcessed = FALSE;
84         bool FNProcessed = FALSE;
85         bool GenderProcessed = FALSE;
86         bool NameProcessed = FALSE;
87         bool KindProcessed = FALSE;
88         bool FNFirst = FALSE;
89         bool NicknameFirst = FALSE;
90         bool TitleFirst = FALSE;
91         bool OrganisationFirst = FALSE;
92         bool NoteFirst = FALSE;
93         bool PhotoFirst = FALSE;
94         bool LogoFirst = FALSE;
95         int intExtraNickname = 0;
96         wxString wxSProperty;
97         wxString wxSPropertySeg1;
98         wxString wxSPropertySeg2;
99         wxString wxSPropertyNextLine;
100         int ContactLineLen = 0;
101         int QuoteBreakPoint = 0;
102         int FNCount = 0;
103         int NameCount = 0;
104         int NicknameCount = 0;
105         int ADRCount = 0;
106         int EmailCount = 0;
107         int IMPPCount = 0;
108         int TelCount = 0;
109         int LangCount = 0;
110         int TZCount = 0;
111         int GeoCount = 0;
112         int URLCount = 0;
113         int RelatedCount = 0;
114         int TitleCount = 0;
115         int RoleCount = 0;
116         int OrgCount = 0;
117         int NoteCount = 0;
118         int CategoryCount = 0;
119         int PhotoCount = 0;
120         int LogoCount = 0;
121         int SoundCount = 0;
122         int CalAdrCount = 0;
123         int CalReqAdrCount = 0;
124         int FreeBusyCount = 0;
125         int KeyCount = 0;
126         int VendorCount = 0;
127         int XTokenCount = 0;
128         int ItemSeek = 1;
129         //int intValueSeek = 1;
130         
131         wxString strVer;
132     
133     // Setup the version string.
134         
135         strVer.Append(wxT("-//Xestia//Address Book Version "));
136         strVer.Append(wxT(XSDAB_VERSION));
137         strVer.Append(wxT("//KW"));
138         
139         ContactDatav3.AddRaw(wxT("BEGIN"), wxT("VCARD"));
140         ContactDatav3.AddRaw(wxT("VERSION"), wxT("3.0"));
141         ContactDatav3.AddRaw(wxT("PRODID"), strVer);
143         for (std::map<int,wxString>::iterator iter = ContactFileLines.begin(); 
144          iter != ContactFileLines.end(); ++iter){
145         
146                 // Find the colon which splits the start bit from the data part.
147                 
148                 ContactLine = iter->second;
149                 
150                 while (ExtraLineSeek == TRUE){
151                 
152                         // Check if there is extra data on the next line 
153                         // (indicated by space or tab at the start) and add data.
154                 
155                         iter++;
156                         
157                         if (iter == ContactFileLines.end()){
158                         
159                                 iter--;
160                                 break;
161                         
162                         }                       
163                 
164                         wxSPropertyNextLine = iter->second;
165                         
166                 
167                         if (wxSPropertyNextLine.Mid(0, 1) == wxT(" ") || wxSPropertyNextLine.Mid(0, 1) == wxT("\t")){
168                 
169                                 wxSPropertyNextLine.Remove(0, 1);
170                                 //wxSPropertyNextLine.Trim(FALSE);
171                                 //ContactLine.Trim();
172                                 ContactLine.Append(wxSPropertyNextLine);
173                 
174                         } else {
175                         
176                                 iter--;
177                                 ExtraLineSeek = FALSE;
178                         
179                         }
180                 
181                 }
183                 ContactLineLen = ContactLine.Len();
184                 
185                 // Make sure we are not in quotation mode.
186                 // Make sure colon does not have \ or \\ before it.
187                 
188                 wxSProperty.Clear();
189                 
190                 for (int i = 0; i <= ContactLineLen; i++){
191                 
192                         if ((ContactLine.Mid(i, 1) == wxT(";") || ContactLine.Mid(i, 1) == wxT(":")) && PropertyFind == TRUE){
193                         
194                                 PropertyFind = FALSE;
195                         
196                         } else if (PropertyFind == TRUE){
197                         
198                                 wxSProperty.Append(ContactLine.Mid(i, 1));
199                         
200                         }               
201                 
202                         if (ContactLine.Mid(i, 1) == wxT("\"")){
203                         
204                                 if (QuoteMode == TRUE){
205                                 
206                                         QuoteMode = FALSE;
207                                 
208                                 } else {
209                         
210                                         QuoteMode = TRUE;
211                                         
212                                 }
213                         
214                         }
215                         
216                         if (ContactLine.Mid(i, 1) == wxT(":") && ContactLine.Mid((i - 1), 1) != wxT("\\") && QuoteMode == FALSE){
217                         
218                                 QuoteBreakPoint = i;
219                                 break;
220                         
221                         }
222                 
223                 }
224                 
225                 // Split that line at the point into two variables (ignore the colon).
226                 
227                 wxSPropertySeg1 = ContactLine.Mid(0, QuoteBreakPoint);
228                 wxSPropertySeg2 = ContactLine.Mid((QuoteBreakPoint + 1));
229                 
230                 // Add the data into the contact editor depending on what it is.
231                 
232                 if (wxSProperty == wxT("FN")){
233                         
234                         int intPropertyLen = wxSPropertySeg1.Len();
235                         std::map<int, int> SplitPoints;
236                         std::map<int, int> SplitLength;
237                         std::map<int, int>::iterator SLiter;                    
238                         wxString PropertyData;
239                         wxString PropertyName;
240                         wxString PropertyValue;
241                         wxString PropertyTokens;
242                         bool AfterFirstToken = FALSE;
243                         bool FirstToken = TRUE;                 
244                         int intSplitsFound = 0;
245                         int intSplitSize = 0;
246                         int intPrevValue = 4;
247                         int intPref = 0;                        
248                         int intType = 0;
249                         int intSplitSeek = 0;
251                         
252                         //SplitValues(&wxSPropertySeg1, &SplitPoints, &SplitLength, intPrevValue);
253                         
254                         intPrevValue = 3;
255                         
256                         if (FNFirst == FALSE){
258                                 ContactDatav3.AddRaw(wxT("FN"), wxSPropertySeg2);
259                                 
260                                 if (((QuoteBreakPoint + 1) - intPrevValue) <= 0){
261         
262                                 } else {
263                                 
264                                         ContactDatav3.AddRaw(wxT("X-VCARD4-FN;X-FIRST=TRUE;") + ContactLine.Mid(intPrevValue, ((QuoteBreakPoint + 1) - (intPrevValue + 1))), wxSPropertySeg2);
265                                                                 
266                                 }
267                                 FNFirst = TRUE;
268                         
269                         } else {
270                         
271                                 if (((QuoteBreakPoint + 1) - intPrevValue) <= 0){
273                                         ContactDatav3.AddRaw(wxT("X-VCARD4-FN"), wxSPropertySeg2);
274         
275                                 } else {
276                                 
277                                         ContactDatav3.AddRaw(wxT("X-VCARD4-FN;") + ContactLine.Mid(intPrevValue, ((QuoteBreakPoint + 1) - (intPrevValue + 1))),
278                                                 wxSPropertySeg2);
279                                 
280                                 }
281                         
282                         }       
283                 
284                 } else if (wxSProperty == wxT("N") && NameProcessed == FALSE){
285                 
286                         int intPropertyLen = wxSPropertySeg1.Len();
287                         std::map<int, int> SplitPoints;
288                         std::map<int, int> SplitLength;
289                         std::map<int, int>::iterator SLiter;                    
290                         wxString PropertyData;
291                         wxString PropertyName;
292                         wxString PropertyValue;
293                         wxString PropertyTokens;
294                         bool AfterFirstToken = FALSE;
295                         bool FirstToken = TRUE;                 
296                         int intSplitsFound = 0;
297                         int intSplitSize = 0;
298                         int intPrevValue = 3;
299                         int intPref = 0;                        
300                         int intType = 0;
301                         int intSplitSeek = 0;
304                         intPrevValue = 2;
306                         ContactDatav3.AddRaw(wxT("N"), wxSPropertySeg2);
307                         
308                         if (((QuoteBreakPoint + 1) - intPrevValue) <= 0){
312                         } else {
313                         
314                                 ContactDatav3.AddRaw(wxT("X-VCARD4-N;") + ContactLine.Mid(intPrevValue, ((QuoteBreakPoint + 1) - (intPrevValue + 1))), wxT(""));
315                         
316                         }
317                         
318                         NameProcessed = TRUE;
319                 
320                 } else if (wxSProperty == wxT("KIND") && KindProcessed == FALSE){
321                 
322                         // Process Data.
323                 
324                         int intPropertyLen = wxSPropertySeg1.Len();
325                         std::map<int, int> SplitPoints;
326                         std::map<int, int> SplitLength;
327                         std::map<int, int>::iterator SLiter;                    
328                         wxString PropertyData;
329                         wxString PropertyName;
330                         wxString PropertyValue;
331                         wxString PropertyTokens;
332                         bool AfterFirstToken = FALSE;
333                         bool FirstToken = TRUE;                 
334                         int intSplitsFound = 0;
335                         int intSplitSize = 0;
336                         int intPrevValue = 5;
337                         int intPref = 0;                        
338                         int intType = 0;
339                         int intSplitSeek = 0;
342                         intPrevValue = 4;
343                 
344                         ContactDatav3.AddRaw(wxT("X-ADDRESSBOOKSERVER-KIND"), wxSPropertySeg2);
345                 
346                         KindProcessed = TRUE;
347                 
348                 } else if (wxSProperty == wxT("MEMBER")){
349                 
350                         // Process Data.
351                         
352                         int intPropertyLen = wxSPropertySeg1.Len();
353                         std::map<int, int> SplitPoints;
354                         std::map<int, int> SplitLength;
355                         std::map<int, int>::iterator SLiter;                    
356                         wxString PropertyData;
357                         wxString PropertyName;
358                         wxString PropertyValue;
359                         wxString PropertyTokens;
360                         bool AfterFirstToken = FALSE;
361                         bool FirstToken = TRUE;                 
362                         int intSplitsFound = 0;
363                         int intSplitSize = 0;
364                         int intPrevValue = 7;
365                         int intPref = 0;                        
366                         int intType = 0;
367                         int intSplitSeek = 0;
370                         intPrevValue = 6;
372                         ContactDatav3.AddRaw(wxT("X-ADDRESSBOOKSERVER-MEMBER"), wxSPropertySeg2);
373                 
374                 } else if (wxSProperty == wxT("NICKNAME")){
375                         
376                         int intPropertyLen = wxSPropertySeg1.Len();
377                         std::map<int, int> SplitPoints;
378                         std::map<int, int> SplitLength;
379                         std::map<int, int>::iterator SLiter;                    
380                         wxString PropertyData;
381                         wxString PropertyName;
382                         wxString PropertyValue;
383                         wxString PropertyTokens;
384                         bool AfterFirstToken = FALSE;
385                         bool FirstToken = TRUE;                 
386                         int intSplitsFound = 0;
387                         int intSplitSize = 0;
388                         int intPrevValue = 10;
389                         int intPref = 0;                        
390                         int intType = 0;
391                         int intSplitSeek = 0;
394                         intPrevValue = 9;
395                         
396                         if (NicknameFirst == FALSE){
398                                 ContactDatav3.AddRaw(wxT("NICKNAME"), wxSPropertySeg2);
399                                 
400                                 if (((QuoteBreakPoint + 1) - intPrevValue) <= 0){
401         
402                                 } else {
403                                 
404                                         ContactDatav3.AddRaw(wxT("X-VCARD4-NICKNAME;X-FIRST=TRUE;") 
405                                                 + ContactLine.Mid(intPrevValue, ((QuoteBreakPoint + 1) - (intPrevValue + 1))), wxT(""));
406                                 
407                                 }
408                                 NicknameFirst = TRUE;
409                                 ItemSeek++;
410                         
411                         } else {
412                         
413                                 if (((QuoteBreakPoint + 1) - intPrevValue) <= 0){
415                                         ContactDatav3.AddRaw(wxT("X-VCARD4-NICKNAME"), wxSPropertySeg2);
417                                 } else {
418                                 
419                                         ContactDatav3.AddRaw(wxT("X-VCARD4-NICKNAME;") + ContactLine.Mid(intPrevValue, ((QuoteBreakPoint + 1) - (intPrevValue + 1))) + wxT(":"), 
420                                                 wxSPropertySeg2);
421                                                                 
422                                 }
423                         
424                         }
425                         
427                 } else if (wxSProperty == wxT("GENDER") && GenderProcessed == FALSE){
428                 
429                         // Do PID/ALTID/LANG things.
430                         
431                         int intPropertyLen = wxSPropertySeg1.Len();
432                         std::map<int, int> SplitPoints;
433                         std::map<int, int> SplitLength;
434                         std::map<int, int>::iterator SLiter;                    
435                         wxString PropertyData;
436                         wxString PropertyName;
437                         wxString PropertyValue;
438                         wxString PropertyTokens;
439                         bool AfterFirstToken = FALSE;
440                         bool FirstToken = TRUE;;
441                         int intSplitsFound = 0;
442                         int intSplitSize = 0;
443                         int intPrevValue = 8;
444                         int intPref = 0;                        
445                         int intType = 0;
446                         int intSplitSeek = 0;
448                         
449                         intPrevValue = 7;
450                         
451                         if (wxSPropertySeg2.Mid(1, 1) == wxT(";")){
452                         
453                                 if (((QuoteBreakPoint + 1) - intPrevValue) <= 0){
455                                         ContactDatav3.AddRaw(wxT("X-VCARD4-GENDER;X-GENDERTEXT=\"") + wxSPropertySeg2.Mid(2) + wxT("\""), wxSPropertySeg2.Mid(0, 1));
456         
457                                 } else {
458                                 
459                                         ContactDatav3.AddRaw(wxT("X-VCARD4-GENDER;X-GENDERTEXT=\"") + wxSPropertySeg2.Mid(2) + wxT("\";") 
460                                                 + ContactLine.Mid(intPrevValue, ((QuoteBreakPoint + 1) - (intPrevValue + 1))), 
461                                                 wxSPropertySeg2.Mid(0, 1));                             
462                                                                 
463                                 }
464                         
465                         } else {
467                                 if (((QuoteBreakPoint + 1) - intPrevValue) <= 0){
469                                         ContactDatav3.AddRaw(wxT("X-VCARD4-GENDER"), wxSPropertySeg2);
470         
471                                 } else {
472                                         
473                                         ContactDatav3.AddRaw(wxT("X-VCARD4-GENDER;") + ContactLine.Mid(intPrevValue, ((QuoteBreakPoint + 1) - (intPrevValue + 1))), wxSPropertySeg2);
474                                                                 
475                                 }
476                         
477                         }
478                         
479                         GenderProcessed = TRUE;
480                 
481                 } else if (wxSProperty == wxT("BDAY") && BirthdayProcessed == FALSE){
483                         // Process date. Preserve the remainder in the string.
484                                 
485                         int intPropertyLen = wxSPropertySeg1.Len();
486                         std::map<int, int> SplitPoints;
487                         std::map<int, int> SplitLength;
488                         std::map<int, int>::iterator SLiter;                    
489                         wxString PropertyData;
490                         wxString PropertyName;
491                         wxString PropertyValue;
492                         wxString PropertyTokens;
493                         bool AfterFirstToken = FALSE;
494                         bool BirthdayText = FALSE;
495                         bool FirstToken = TRUE;
496                         bool NoYear = FALSE;            
497                         int intSplitsFound = 0;
498                         int intSplitSize = 0;
499                         int intPrevValue = 6;
500                         int intPref = 0;                        
501                         int intType = 0;
502                         int intSplitSeek = 0;
504                         wxString strResults;            
505                 
506                         intPrevValue = 5;
507                 
508                         // Look for type before continuing.
510                         if (wxSPropertySeg2.Mid(0, 2) == wxT("--")){
511                         
512                                 strResults.Append(wxT("1604-"));
513                                 NoYear = TRUE;
515                                 strResults.Append(wxSPropertySeg2.Mid(2, 2) + wxT("-"));
516                                 strResults.Append(wxSPropertySeg2.Mid(4, 2));
517                         
518                         } else {
519                         
520                                 strResults.Append(wxSPropertySeg2.Mid(0, 4) + wxT("-"));
521                                 strResults.Append(wxSPropertySeg2.Mid(4, 2) + wxT("-"));
522                                 strResults.Append(wxSPropertySeg2.Mid(6, 2));
524                         }
525                         
527                         
528                         if (NoYear == TRUE){
530                                 ContactDatav3.AddRaw(wxT("BDAY;X-APPLE-OMIT-YEAR=1604"), strResults);
531                         
532                                 if (((QuoteBreakPoint + 1) - intPrevValue) <= 0){
534                                         ContactDatav3.AddRaw(wxT("X-VCARD4-BDAY"), wxSPropertySeg2);
535         
536                                 } else {
537                                         
538                                         ContactDatav3.AddRaw(wxT("X-VCARD4-BDAY;") + ContactLine.Mid(intPrevValue, ((QuoteBreakPoint + 1) - (intPrevValue + 1))), wxSPropertySeg2);
539                                 
540                                 }
541                         
542                         } else {
543                         
544                                 ContactDatav3.AddRaw(wxT("BDAY"), strResults);
546                                 if (((QuoteBreakPoint + 1) - intPrevValue) <= 0){
548                                         ContactDatav3.AddRaw(wxT("X-VCARD4-BDAY"), wxSPropertySeg2);
550                                 } else {
551                                         
552                                         ContactDatav3.AddRaw(wxT("X-VCARD4-BDAY;") + ContactLine.Mid(intPrevValue, ((QuoteBreakPoint + 1) - (intPrevValue + 1))), wxSPropertySeg2);
553                                                                 
554                                 }
555                         
556                         }
557                         
558                         BirthdayProcessed = TRUE;
559                 
560                 } else if (wxSProperty == wxT("ANNIVERSARY") && AnniversaryProcessed == FALSE){
561                         
562                         // Process date. Preserve the remainder in the string.
563                                 
564                         int intPropertyLen = wxSPropertySeg1.Len();
565                         std::map<int, int> SplitPoints;
566                         std::map<int, int> SplitLength;
567                         std::map<int, int>::iterator SLiter;                    
568                         wxString PropertyData;
569                         wxString PropertyName;
570                         wxString PropertyValue;
571                         wxString PropertyTokens;
572                         bool AfterFirstToken = FALSE;
573                         bool AnniversaryText = FALSE;
574                         bool FirstToken = TRUE;                         
575                         int intSplitsFound = 0;
576                         int intSplitSize = 0;
577                         int intPrevValue = 13;
578                         int intPref = 0;                        
579                         int intType = 0;
580                         int intSplitSeek = 0;
582                         wxString strResults;
583                         bool NoYear = FALSE;
584                 
585                         intPrevValue = 12;
586                 
587                         // Look for type before continuing.
588                 
589                         if (wxSPropertySeg2.Mid(0, 2) == wxT("--")){
590                         
591                                 strResults.Append(wxT("1604-"));
592                                 NoYear = TRUE;
594                                 strResults.Append(wxSPropertySeg2.Mid(2, 2) + wxT("-"));
595                                 strResults.Append(wxSPropertySeg2.Mid(4, 2));
596                         
597                         } else {
598                         
599                                 strResults.Append(wxSPropertySeg2.Mid(0, 4) + wxT("-"));
600                                 strResults.Append(wxSPropertySeg2.Mid(4, 2) + wxT("-"));
601                                 strResults.Append(wxSPropertySeg2.Mid(6, 2));
603                         }
604                         
606                         
607                         if (NoYear == TRUE){
609                                 ContactDatav3.AddRaw(wxT("ANNIVERSARY;X-APPLE-OMIT-YEAR=1604"), strResults);
610                         
611                                 if (((QuoteBreakPoint + 1) - intPrevValue) <= 0){
613                                         ContactDatav3.AddRaw(wxT("X-VCARD4-ANNIVERSARY"), wxSPropertySeg2);
615                                 } else {
616                                         
617                                         ContactDatav3.AddRaw(wxT("X-VCARD4-ANNIVERSARY;") + ContactLine.Mid(intPrevValue, ((QuoteBreakPoint + 1) - (intPrevValue + 1))), wxSPropertySeg2);
618                                                                 
619                                 }
620                         
621                         } else {
622                         
623                                 ContactDatav3.AddRaw(wxT("ANNIVERSARY"), strResults);
625                                 if (((QuoteBreakPoint + 1) - intPrevValue) <= 0){
627                                         ContactDatav3.AddRaw(wxT("X-VCARD4-ANNIVERSARY"), wxSPropertySeg2);
628         
629                                 } else {
630                                         
631                                         ContactDatav3.AddRaw(wxT("X-VCARD4-ANNIVERSARY;") + ContactLine.Mid(intPrevValue, ((QuoteBreakPoint + 1) - (intPrevValue + 1))), wxSPropertySeg2);
632                                 
633                                 }
634                         
635                         }
636                         
637                         AnniversaryProcessed = TRUE;
638                 
639                 } else if (wxSProperty == wxT("TZ")){
640                 
641                         int intPropertyLen = wxSPropertySeg1.Len();
642                         std::map<int, int> SplitPoints;
643                         std::map<int, int> SplitLength;
644                         std::map<int, int>::iterator SLiter;                    
645                         wxString PropertyData;
646                         wxString PropertyName;
647                         wxString PropertyValue;
648                         wxString PropertyTokens;
649                         bool AfterFirstToken = FALSE;
650                         bool FirstToken = TRUE;                 
651                         int intSplitsFound = 0;
652                         int intSplitSize = 0;
653                         int intPrevValue = 4;
654                         int intPref = 0;                        
655                         int intType = 0;
656                         int intSplitSeek = 0;
658                         
659                         intPrevValue = 3;
660                         
661                         // Look for type before continuing.
662                         
663                         if (((QuoteBreakPoint + 1) - intPrevValue) <= 0){
665                                 ContactDatav3.AddRaw(wxT("X-VCARD4-TZ"), wxSPropertySeg2);
666         
667                         } else {
668                                         
669                                 ContactDatav3.AddRaw(wxT("X-VCARD4-TZ;") + ContactLine.Mid(intPrevValue, ((QuoteBreakPoint + 1) - (intPrevValue + 1))), wxSPropertySeg2);
670                                 
671                         }
672                 
673                 } else if (wxSProperty == wxT("ADR")){
674                         
675                         int intPropertyLen = wxSPropertySeg1.Len();
676                         std::map<int, int> SplitPoints;
677                         std::map<int, int> SplitLength;
678                         std::map<int, int>::iterator SLiter;                    
679                         wxString PropertyData;
680                         wxString PropertyName;
681                         wxString PropertyValue;
682                         wxString PropertyTokens;
683                         wxString AddressLabel;
684                         wxString AddressLang;
685                         wxString AddressAltID;
686                         wxString AddressPID;
687                         wxString AddressTokens;
688                         wxString AddressGeo;
689                         wxString AddressTimezone;
690                         wxString AddressType;
691                         wxString AddressMediatype;
692                         wxString AddressPOBox;
693                         wxString AddressExtended;
694                         wxString AddressStreet;
695                         wxString AddressLocality;
696                         wxString AddressCity;
697                         wxString AddressRegion;
698                         wxString AddressPostalCode;
699                         wxString AddressCountry;
700                         bool AfterFirstToken = FALSE;
701                         bool FirstToken = TRUE;                 
702                         int intSplitsFound = 0;
703                         int intSplitSize = 0;
704                         int intPrevValue = 5;
705                         int intPref = 0;                        
706                         int intType = 0;
707                         int intSplitSeek = 0;
709                         
710                         intPrevValue = 4;
711                         
712                         // TODO: Check in value for X-ABLabel and use it if it is there.
713                     
714                         if (((QuoteBreakPoint + 1) - intPrevValue) <= 0){
716                                 ContactDatav3.AddRaw(wxT("item") + wxString::Format(wxT("%i"), ItemSeek) + wxT(".ADR"), wxSPropertySeg2);
717                                 ContactDatav3.AddRaw(wxT("item") + wxString::Format(wxT("%i"), ItemSeek) + wxT(".X-ABLabel"), _("Address"));
718                                 ContactDatav3.AddRaw(wxT("item") + wxString::Format(wxT("%i"), ItemSeek) + wxT(".X-VCARD4-ADR"), wxSPropertySeg2);
719         
720                         } else {
722                                 ContactDatav3.AddRaw(wxT("item") + wxString::Format(wxT("%i"), ItemSeek) + wxT(".ADR"), wxSPropertySeg2);
723                                 ContactDatav3.AddRaw(wxT("item") + wxString::Format(wxT("%i"), ItemSeek) + wxT(".X-ABLabel"), _("Address"));
724                                 ContactDatav3.AddRaw(wxT("item") + wxString::Format(wxT("%i"), ItemSeek) + wxT(".X-VCARD4-ADR;") + ContactLine.Mid(intPrevValue, ((QuoteBreakPoint + 1) - (intPrevValue + 1))), wxSPropertySeg2);
725                                                                 
726                         }
727                         
728                         ItemSeek++;
729                 
730                 } else if (wxSProperty == wxT("EMAIL")){
731                 
732                         // TODO: Continue from here! See ADR for good example (Replace initer with intPrevValue).
733                         // Remove inserted comma for Extra Tokens in frmContactEditor.cpp
734                 
735                         int intPropertyLen = wxSPropertySeg1.Len();
736                         std::map<int, int> SplitPoints;
737                         std::map<int, int> SplitLength;
738                         std::map<int, int>::iterator SLiter;
739                         std::map<int, int>::iterator SPoint;
740                         wxString PropertyData;
741                         wxString PropertyName;
742                         wxString PropertyValue;
743                         wxString PropertyTokens;
744                         wxString AddressLabel;
745                         wxString AddressLang;
746                         wxString AddressAltID;
747                         wxString AddressPID;
748                         wxString AddressTokens;
749                         wxString AddressGeo;
750                         wxString AddressTimezone;
751                         wxString AddressType;
752                         wxString AddressMediatype;
753                         wxString AddressPOBox;
754                         wxString AddressExtended;
755                         wxString AddressStreet;
756                         wxString AddressLocality;
757                         wxString AddressCity;
758                         wxString AddressRegion;
759                         wxString AddressPostalCode;
760                         wxString AddressCountry;
761                         bool AfterFirstProperty = FALSE;
762                         bool FirstToken = TRUE;                 
763                         int intSplitSeek = 0;
764                         int intSplitsFound = 0;
765                         int intSplitSize = 0;
766                         int intPrevValue = 7;
767                         int intPref = 0;                        
768                         int intType = 0;
769                         int intSplitPoint = 0;
771                         
772                         intPrevValue = 6;
773                         
774                     // TODO: Check in value for X-ABLabel and use it if it is there.
775                     
776                     if (((QuoteBreakPoint + 1) - intPrevValue) <= 0){
777                         
778                         ContactDatav3.AddRaw(wxT("item") + wxString::Format(wxT("%i"), ItemSeek) + wxT(".EMAIL"), wxSPropertySeg2);
779                         ContactDatav3.AddRaw(wxT("item") + wxString::Format(wxT("%i"), ItemSeek) + wxT(".X-ABLabel"), _("E-mail Address"));
780                         ContactDatav3.AddRaw(wxT("item") + wxString::Format(wxT("%i"), ItemSeek) + wxT(".X-VCARD4-EMAIL"), wxSPropertySeg2);
781                                                 
782                     } else {
783                         
784                         ContactDatav3.AddRaw(wxT("item") + wxString::Format(wxT("%i"), ItemSeek) + wxT(".EMAIL"), wxSPropertySeg2);
785                         ContactDatav3.AddRaw(wxT("item") + wxString::Format(wxT("%i"), ItemSeek) + wxT(".X-ABLabel"), _("E-mail Address"));
786                         ContactDatav3.AddRaw(wxT("item") + wxString::Format(wxT("%i"), ItemSeek) + wxT(".X-VCARD4-EMAIL;") + ContactLine.Mid(intPrevValue, ((QuoteBreakPoint + 1) - (intPrevValue + 1))), wxSPropertySeg2);
787                         
788                     }
789                     
790                     ItemSeek++;
791                 
792                 } else if (wxSProperty == wxT("IMPP")){
793                 
794                         int intPropertyLen = wxSPropertySeg1.Len();
795                         std::map<int, int> SplitPoints;
796                         std::map<int, int> SplitLength;
797                         std::map<int, int>::iterator SLiter;
798                         std::map<int, int>::iterator SPoint;
799                         wxString PropertyData;
800                         wxString PropertyName;
801                         wxString PropertyValue;
802                         wxString PropertyTokens;
803                         wxString IMPPType;
804                         wxString IMPPAddress;
805                         bool AfterFirstProperty = FALSE;
806                         bool FirstToken = TRUE;                 
807                         int intSplitSeek = 0;
808                         int intSplitsFound = 0;
809                         int intSplitSize = 0;
810                         int intPrevValue = 6;
811                         int intPref = 0;
812                         int intType = 0;
813                         int intSplitPoint = 0;
815                         
816                         SplitValues(&wxSPropertySeg1, &SplitPoints, &SplitLength, intPrevValue);
817                         
818                         intPrevValue = 5;
819                         
820                         // TODO: Check in value for X-ABLabel and use it if it is there.
821                     
822                         if (((QuoteBreakPoint + 1) - intPrevValue) <= 0){
824                                 ContactDatav3.AddRaw(wxT("item") + wxString::Format(wxT("%i"), ItemSeek) + wxT(".IMPP"), wxSPropertySeg2);
825                                 ContactDatav3.AddRaw(wxT("item") + wxString::Format(wxT("%i"), ItemSeek) + wxT(".X-ABLabel"), _("Instant Message"));
826                                 ContactDatav3.AddRaw(wxT("item") + wxString::Format(wxT("%i"), ItemSeek) + wxT(".X-VCARD4-IMPP"), wxSPropertySeg2);
827         
828                         } else {
830                                 ContactDatav3.AddRaw(wxT("item") + wxString::Format(wxT("%i"), ItemSeek) + wxT(".IMPP"), wxSPropertySeg2);
831                                 ContactDatav3.AddRaw(wxT("item") + wxString::Format(wxT("%i"), ItemSeek) + wxT(".X-ABLabel"), _("Instant Message"));
832                                 ContactDatav3.AddRaw(wxT("item") + wxString::Format(wxT("%i"), ItemSeek) + wxT(".X-VCARD4-IMPP;") + ContactLine.Mid(intPrevValue, ((QuoteBreakPoint + 1) - (intPrevValue + 1))), wxSPropertySeg2);
833                                                                 
834                         }
835                     
836                         ItemSeek++;
837                 
838                 } else if (wxSProperty == wxT("TEL")){
839                 
840                         // Check TEL and make sure it is functioning properly.
841                 
842                         int intPropertyLen = wxSPropertySeg1.Len();
843                         std::map<int, int> SplitPoints;
844                         std::map<int, int> SplitLength;
845                         std::map<int, int> TypeSplitPoints;
846                         std::map<int, int> TypeSplitLength;
847                         std::map<int, int>::iterator SLiter;
848                         std::map<int, int>::iterator SPoint;                    
849                         std::map<int, int>::iterator TSLiter;
850                         std::map<int, int>::iterator TSPoint;
851                         wxString PropertyData;
852                         wxString PropertyName;
853                         wxString PropertyValue;
854                         wxString PropertyTokens;
855                         wxString TelType;
856                         wxString TelNumber;
857                         wxString TelTypeUI;
858                         wxString TelTypeDetail;
859                         wxString TelTypeOut;
860                         wxString FinalFriendlyString;
861                         bool AfterFirstProperty = FALSE;
862                         bool FirstToken = TRUE;
863                         bool SkipFirst = TRUE;          
864                         int intSplitSeek = 0;
865                         int intSplitsFound = 0;
866                         int intSplitSize = 0;
867                         int intPrevValue = 5;
868                         int intPref = 0;                        
869                         int intType = 0;
870                         int intSplitPoint = 0;
872                         
873                         intPrevValue = 4;
874                         
875                         SplitValues(&wxSPropertySeg1, &SplitPoints, &SplitLength, intPrevValue);
876                         
877                         // Look for type before continuing.
878                         
879                         for (std::map<int, int>::iterator intiter = SplitPoints.begin(); 
880                         intiter != SplitPoints.end(); ++intiter){
881                         
882                                 SLiter = SplitLength.find(intiter->first);
883                         
884                                 PropertyData = wxSPropertySeg1.Mid(intPrevValue, (SLiter->second));
885                                 
886                                 wxStringTokenizer PropertyElement (PropertyData, wxT("="));
887                                 PropertyName = PropertyElement.GetNextToken();                          
888                                 PropertyValue = PropertyElement.GetNextToken();
889                                 
890                                 intPrevValue = intiter->second;
891                                 
892                                 if (PropertyName == wxT("TYPE")){
893                                 
894                                         // Process each value in type and translate each
895                                         // part.
896                                 
897                                         // Strip out the quotes if they are there.
899                                         int intPropertyValueLen = PropertyValue.Len();
900                                 
901                                         if (PropertyValue.Mid((intPropertyValueLen - 1), 1) == wxT("\"")){
902                                         
903                                                 PropertyValue.Trim();
904                                                 PropertyValue.RemoveLast();
905                                         
906                                         }                               
907                                 
908                                         if (PropertyValue.Mid(0, 1) == wxT("\"")){
909                                         
910                                                 PropertyValue.Remove(0, 1);
911                                         
912                                         }
913                                         
914                                         TelTypeDetail = PropertyValue;
915                                         
916                                         intSplitSize = 0;
917                                         intSplitsFound = 0;
918                                         intSplitPoint = 0;
919                                         
920                                         for (int i = 0; i <= intPropertyValueLen; i++){
921                         
922                                                 intSplitSize++;
923                         
924                                                 if (PropertyValue.Mid(i, 1) == wxT(",") && PropertyValue.Mid((i - 1), 1) != wxT("\\")){
925                         
926                                                         if (intSplitsFound == 0){
928                                                                 TypeSplitPoints.insert(std::make_pair(intSplitsFound, intSplitPoint));
929                                                                 TypeSplitLength.insert(std::make_pair(intSplitsFound, (intSplitSize - 1)));
930                                         
931                                                         } else {
932                                         
933                                                                 TypeSplitPoints.insert(std::make_pair(intSplitsFound, intSplitPoint));
934                                                                 TypeSplitLength.insert(std::make_pair(intSplitsFound, intSplitSize));
935                                         
936                                                         }                       
938                                                         intSplitsFound++;
939                                                         i++;
940                                                         intSplitPoint = i;
941                                                         intSplitSize = 0;
942                         
943                                                 }
944                         
945                                         }
946                                         
947                                         TypeSplitPoints.insert(std::make_pair(intSplitsFound, intSplitPoint));
948                                         TypeSplitLength.insert(std::make_pair(intSplitsFound, intSplitSize));                                                           
949                                 
950                                         int intTypeSeek = 0;
951                                 
952                                         for (std::map<int, int>::iterator typeiter = TypeSplitPoints.begin(); 
953                                         typeiter != TypeSplitPoints.end(); ++typeiter){
955                                                 wxString TypePropertyName;
956                                                 
957                                                 TSLiter = TypeSplitLength.find(typeiter->first);
958                                                 
959                                                 TypePropertyName = PropertyValue.Mid(typeiter->second, TSLiter->second);
960                                                 
961                                                 if (intTypeSeek == 0){
962                                                 
963                                                 
964                                                 } else {
965                                                                                                 
966                                                         TelTypeUI.Append(wxT(","));                                                     
967                                                 
968                                                 }
969                                         
970                                                 if (TypePropertyName == wxT("home")){
971                                                 
972                                                         intType = 1;
973                                                 
974                                                 } else if (TypePropertyName == wxT("work")){
975                                                 
976                                                         intType = 2;
977                                                 
978                                                 }
979                                                 
980                                                 if (TypePropertyName == wxT("text")){                                           
982                                                         if (!FinalFriendlyString.IsEmpty()){ FinalFriendlyString.Append(_(", Text")); } else { FinalFriendlyString.Append(_("Text")); }
984                                                         TelTypeOut.Append(wxT(";"));                                            
985                                                         TelTypeOut.Append(wxT("type=TEXT"));
986                                                 
987                                                 } else if (TypePropertyName == wxT("voice")){
988                                                 
989                                                         if (!FinalFriendlyString.IsEmpty()){  FinalFriendlyString.Append(_(", Voice")); } else { FinalFriendlyString.Append(_("Voice")); }
991                                                         TelTypeOut.Append(wxT(";"));                                            
992                                                         TelTypeOut.Append(wxT("type=VOICE"));
994                                                         intTypeSeek++;
995                                                 
996                                                 } else if (TypePropertyName == wxT("fax")){
997                                                 
998                                                         if (!FinalFriendlyString.IsEmpty()){  FinalFriendlyString.Append(_(", Fax")); } else { FinalFriendlyString.Append(_("Fax")); }
999                                                 
1000                                                         TelTypeOut.Append(wxT(";"));
1001                                                         TelTypeOut.Append(wxT("type=FAX"));
1002                                                         intTypeSeek++;
1003                                                 
1004                                                 } else if (TypePropertyName == wxT("cell")){
1005                                                 
1006                                                         if (!FinalFriendlyString.IsEmpty()){  FinalFriendlyString.Append(_(", Mobile")); } else { FinalFriendlyString.Append(_("Mobile")); }
1007                                                 
1008                                                         TelTypeOut.Append(wxT(";"));
1009                                                         TelTypeOut.Append(wxT("type=CELL"));
1010                                                         intTypeSeek++;
1011                                                 
1012                                                 } else if (TypePropertyName == wxT("video")){
1013                                                 
1014                                                         if (!FinalFriendlyString.IsEmpty()){  FinalFriendlyString.Append(_(", Video")); } else { FinalFriendlyString.Append(_("Video")); }
1016                                                         TelTypeOut.Append(wxT(";"));
1017                                                         TelTypeOut.Append(wxT("type=VIDEO"));
1018                                                         intTypeSeek++;
1019                                                 
1020                                                 } else if (TypePropertyName == wxT("pager")){
1021                                                 
1022                                                         if (!FinalFriendlyString.IsEmpty()){  FinalFriendlyString.Append(_(", Pager")); } else { FinalFriendlyString.Append(_("Pager")); }
1024                                                         TelTypeOut.Append(wxT(";"));
1025                                                         TelTypeOut.Append(wxT("type=PAGER"));
1026                                                         intTypeSeek++;
1027                                                 
1028                                                 } else if (TypePropertyName == wxT("textphone")){
1029                                                 
1030                                                         //if (!TelTypeOut.IsEmpty()){ TelTypeOut.Append(wxT(";")); }
1031                                                 
1032                                                         if (!FinalFriendlyString.IsEmpty()){  FinalFriendlyString.Append(_(", Textphone")); } else { FinalFriendlyString.Append(_("Textphone")); }
1033                                                 
1034                                                         TelTypeOut.Append(wxT(";"));
1035                                                         TelTypeOut.Append(wxT("type=TEXTPHONE"));
1036                                                         intTypeSeek++;
1037                                                 
1038                                                 }
1039                                                 
1040                                                 
1041                                         
1042                                         }
1043                                 
1044                                 }
1045                                 
1046                                 
1047                         
1048                         }
1049                         
1050                         wxString FinalTel;
1051                         
1052                         // Remove 'tel:' if it is being used.
1053                         
1054                         if (wxSPropertySeg2.Mid(0, 4) == wxT("tel:")){
1055                         
1056                                 FinalTel = wxSPropertySeg2.Mid(4);
1057                         
1058                         } else {
1059                         
1060                                 FinalTel = wxSPropertySeg2;
1061                         
1062                         }
1063                         
1064                         if (((QuoteBreakPoint + 1) - intPrevValue) <= 0){
1065                         
1066                                 ContactDatav3.AddRaw(wxT("item") + wxString::Format(wxT("%i"), ItemSeek) + wxT(".TEL") + TelTypeOut, FinalTel);
1067                                 ContactDatav3.AddRaw(wxT("item") + wxString::Format(wxT("%i"), ItemSeek) + wxT(".X-ABLabel"), FinalFriendlyString);
1068                                 ContactDatav3.AddRaw(wxT("item") + wxString::Format(wxT("%i"), ItemSeek) + wxT(".X-VCARD4-TEL"), wxSPropertySeg2);
1069         
1070                         } else {
1072                                 ContactDatav3.AddRaw(wxT("item") + wxString::Format(wxT("%i"), ItemSeek) + wxT(".TEL") + TelTypeOut, FinalTel);
1073                                 ContactDatav3.AddRaw(wxT("item") + wxString::Format(wxT("%i"), ItemSeek) + wxT(".X-ABLabel"), FinalFriendlyString);
1074                                 ContactDatav3.AddRaw(wxT("item") + wxString::Format(wxT("%i"), ItemSeek) + wxT(".X-VCARD4-TEL;") + wxSPropertySeg1.Mid(4), wxSPropertySeg2);
1075                                 
1076                         }
1077                         
1078                         ItemSeek++;
1079                 
1080                 } else if (wxSProperty == wxT("LANG")){
1081                 
1082                         int intPropertyLen = wxSPropertySeg1.Len();
1083                         std::map<int, int> SplitPoints;
1084                         std::map<int, int> SplitLength;
1085                         std::map<int, int>::iterator SLiter;                    
1086                         wxString PropertyData;
1087                         wxString PropertyName;
1088                         wxString PropertyValue;
1089                         wxString PropertyTokens;
1090                         bool AfterFirstToken = FALSE;
1091                         bool FirstToken = TRUE;                 
1092                         int intSplitsFound = 0;
1093                         int intSplitSize = 0;
1094                         int intPrevValue = 6;
1095                         int intPref = 0;                        
1096                         int intType = 0;
1097                         int intSplitSeek = 0;
1099                         
1100                         intPrevValue = 5;
1101                         
1102                     if (((QuoteBreakPoint + 1) - intPrevValue) <= 0){
1103                         
1104                         ContactDatav3.AddRaw(wxT("X-VCARD4-LANG"), wxSPropertySeg2);
1105                         
1106                     } else {
1107                         
1108                         ContactDatav3.AddRaw(wxT("X-VCARD4-LANG;") + ContactLine.Mid(intPrevValue, ((QuoteBreakPoint + 1) - (intPrevValue + 1))), wxSPropertySeg2);
1109                         
1110                     }
1111                 
1112                 } else if (wxSProperty == wxT("GEO")){
1113                 
1114                         int intPropertyLen = wxSPropertySeg1.Len();
1115                         std::map<int, int> SplitPoints;
1116                         std::map<int, int> SplitLength;
1117                         std::map<int, int>::iterator SLiter;                    
1118                         wxString PropertyData;
1119                         wxString PropertyName;
1120                         wxString PropertyValue;
1121                         wxString PropertyTokens;
1122                         wxString GeoType;
1123                         wxString GeoData;                       
1124                         bool AfterFirstToken = FALSE;
1125                         bool FirstToken = TRUE;                 
1126                         int intSplitsFound = 0;
1127                         int intSplitSize = 0;
1128                         int intPrevValue = 5;
1129                         int intPref = 0;                        
1130                         int intType = 0;
1131                         int intSplitSeek = 0;
1133                         
1134                         intPrevValue = 4;
1135                         
1136                         SplitValues(&wxSPropertySeg1, &SplitPoints, &SplitLength, intPrevValue);
1137                         
1138                         wxString strFinalGeoValue;
1139                         wxString strFinalType;
1140                         
1141                         if (wxSPropertySeg2.Mid(0, 3) == wxT("geo")){
1142                         
1143                                 strFinalGeoValue = wxSPropertySeg2.Mid(5);
1144                                 strFinalType = wxT("geo");
1145                         
1146                         } else {
1147                         
1148                                 wxStringTokenizer wSTSplit(wxSPropertySeg2, wxT(":")); 
1149                                 strFinalType = wSTSplit.GetNextToken();
1150                                 strFinalGeoValue = wSTSplit.GetNextToken();
1151                         
1152                         }
1153                         
1154                     if (((QuoteBreakPoint + 1) - intPrevValue) <= 0){
1155                         
1156                         ContactDatav3.AddRaw(wxT("X-VCARD4-GEO;X-GEOTYPE=") + strFinalType, wxSPropertySeg2);
1157                         
1158                     } else {
1159                         
1160                         ContactDatav3.AddRaw(wxT("X-VCARD4-GEO;X-GEOTYPE=") + strFinalType + wxT(";") + ContactLine.Mid(intPrevValue, ((QuoteBreakPoint + 1) - (intPrevValue + 1))), wxSPropertySeg2);
1161                         
1162                     }
1163                 
1164                 } else if (wxSProperty == wxT("RELATED")){
1165                         
1166                         int intPropertyLen = wxSPropertySeg1.Len();
1167                         std::map<int, int> SplitPoints;
1168                         std::map<int, int> SplitLength;
1169                         std::map<int, int>::iterator SLiter;                    
1170                         wxString PropertyData;
1171                         wxString PropertyName;
1172                         wxString PropertyValue;
1173                         wxString PropertyTokens;
1174                         wxString RelatedType;
1175                         wxString RelatedTypeOriginal;                   
1176                         wxString RelatedName;           
1177                         bool AfterFirstToken = FALSE;
1178                         bool FirstToken = TRUE;                 
1179                         int intSplitsFound = 0;
1180                         int intSplitSize = 0;
1181                         int intPrevValue = 9;
1182                         int intPref = 0;                        
1183                         int intType = 0;
1184                         int intSplitSeek = 0;
1186                         
1187                         intPrevValue = 8;
1188                         
1189                         SplitValues(&wxSPropertySeg1, &SplitPoints, &SplitLength, intPrevValue);
1190                         
1191                         wxString strDetail;
1192                         
1193                         for (std::map<int, int>::iterator intiter = SplitPoints.begin(); 
1194                         intiter != SplitPoints.end(); ++intiter){
1195                         
1196                                 SLiter = SplitLength.find(intiter->first);
1197                         
1198                                 PropertyData = wxSPropertySeg1.Mid(intPrevValue, (SLiter->second - 1));
1199                                 
1200                                 wxStringTokenizer PropertyElement (PropertyData, wxT("="));
1201                                 PropertyName = PropertyElement.GetNextToken();                          
1202                                 PropertyValue = PropertyElement.GetNextToken();
1203                                 
1204                                 if (PropertyName == wxT("TYPE") && FirstToken == TRUE){
1205                                 
1206                                         if (PropertyValue == wxT("contact")){
1207                 
1208                                                 strDetail = _("Contact");
1209                 
1210                                         } else if (PropertyValue == wxT("acquaintance")){
1211                 
1212                                                 strDetail = _("Acquaintance");
1213                 
1214                                         } else if (PropertyValue == wxT("friend")){
1215                 
1216                                                 strDetail = _("Friend");
1217                 
1218                                         } else if (PropertyValue == wxT("met")){
1219                 
1220                                                 strDetail = _("Met");
1221                 
1222                                         } else if (PropertyValue == wxT("co-worker")){
1223                 
1224                                                 strDetail = _("Co-worker");
1225                 
1226                                         } else if (PropertyValue == wxT("colleague")){
1227                 
1228                                                 strDetail = _("Colleague");
1229                 
1230                                         } else if (PropertyValue == wxT("co-resident")){
1231                 
1232                                                 strDetail = _("Co-resident");
1233                 
1234                                         } else if (PropertyValue == wxT("neighbor")){
1235                 
1236                                                 strDetail = _("Neighbour");
1237                 
1238                                         } else if (PropertyValue == wxT("child")){
1239                 
1240                                                 strDetail = _("Child");
1241                 
1242                                         } else if (PropertyValue == wxT("parent")){
1243                 
1244                                                 strDetail = _("Parent");
1245                 
1246                                         } else if (PropertyValue == wxT("sibling")){
1247                 
1248                                                 strDetail = _("Sibling");
1249                 
1250                                         } else if (PropertyValue == wxT("spouse")){
1251                 
1252                                                 strDetail = _("Spouse");
1253                 
1254                                         } else if (PropertyValue == wxT("kin")){
1255                 
1256                                                 strDetail = _("Kin");
1257                 
1258                                         } else if (PropertyValue == wxT("muse")){
1259                 
1260                                                 strDetail = _("Muse");
1261                 
1262                                         } else if (PropertyValue == wxT("crush")){
1263                 
1264                                                 strDetail = _("Crush");
1265                 
1266                                         } else if (PropertyValue == wxT("date")){
1267                 
1268                                                 strDetail = _("Date");
1269                 
1270                                         } else if (PropertyValue == wxT("sweetheart")){
1271                 
1272                                                 strDetail = _("Sweetheart");
1273                 
1274                                         } else if (PropertyValue == wxT("me")){
1275                 
1276                                                 strDetail = _("Me");
1277                 
1278                                         } else if (PropertyValue == wxT("agent")){
1279                 
1280                                                 strDetail = _("Agent");
1281                 
1282                                         } else if (PropertyValue == wxT("emergency")){
1283                 
1284                                                 strDetail = _("Emergency");
1285                 
1286                                         } else {
1287                 
1288                                                 strDetail = PropertyValue;
1289                 
1290                                         }
1291                                         
1292                                         FirstToken = FALSE;
1293                                 
1294                                 }
1295                                 
1296                         }
1297                         
1298                         if (strDetail.IsEmpty()){
1299                         
1300                                 strDetail = _("Relation");
1301                         
1302                         }
1303                         
1304                         if (((QuoteBreakPoint + 1) - intPrevValue) <= 0){
1305                         
1306                                 ContactDatav3.AddRaw(wxT("item") + wxString::Format(wxT("%i"), ItemSeek) + wxT(".X-ABRELATEDNAMES"), wxSPropertySeg2);
1307                                 ContactDatav3.AddRaw(wxT("item") + wxString::Format(wxT("%i"), ItemSeek) + wxT(".X-ABLabel"), strDetail);
1308                                 ContactDatav3.AddRaw(wxT("item") + wxString::Format(wxT("%i"), ItemSeek) + wxT(".X-VCARD4-RELATED"), wxSPropertySeg2);
1309         
1310                         } else {
1312                                 ContactDatav3.AddRaw(wxT("item") + wxString::Format(wxT("%i"), ItemSeek) + wxT(".X-ABRELATEDNAMES"), wxSPropertySeg2);
1313                                 ContactDatav3.AddRaw(wxT("item") + wxString::Format(wxT("%i"), ItemSeek) + wxT(".X-ABLabel"), strDetail);
1314                                 ContactDatav3.AddRaw(wxT("item") + wxString::Format(wxT("%i"), ItemSeek) + wxT(".X-VCARD4-RELATED;") + ContactLine.Mid(intPrevValue, ((QuoteBreakPoint + 1) - (intPrevValue + 1))), wxSPropertySeg2);
1315                                                                 
1316                         }
1317                         
1318                         ItemSeek++;
1319                 
1320                 } else if (wxSProperty == wxT("URL")){
1321                 
1322                         int intPropertyLen = wxSPropertySeg1.Len();
1323                         std::map<int, int> SplitPoints;
1324                         std::map<int, int> SplitLength;
1325                         std::map<int, int>::iterator SLiter;                    
1326                         wxString PropertyData;
1327                         wxString PropertyName;
1328                         wxString PropertyValue;
1329                         wxString PropertyTokens;
1330                         bool AfterFirstToken = FALSE;
1331                         bool FirstToken = TRUE;                 
1332                         int intSplitsFound = 0;
1333                         int intSplitSize = 0;
1334                         int intPrevValue = 5;
1335                         int intPref = 0;                        
1336                         int intType = 0;
1337                         int intSplitSeek = 0;
1339                         
1340                         intPrevValue = 4;
1341                         
1342                         // Todo: Check for X-ABLabel.
1343                         
1344                         if (((QuoteBreakPoint + 1) - intPrevValue) <= 0){
1345                         
1346                                 ContactDatav3.AddRaw(wxT("item") + wxString::Format(wxT("%i"), ItemSeek) + wxT(".URL"), wxSPropertySeg2);
1347                                 ContactDatav3.AddRaw(wxT("item") + wxString::Format(wxT("%i"), ItemSeek) + wxT(".X-ABLabel"), _("URL"));
1348                                 ContactDatav3.AddRaw(wxT("item") + wxString::Format(wxT("%i"), ItemSeek) + wxT(".X-VCARD4-URL"), wxSPropertySeg2);
1349         
1350                         } else {
1352                                 ContactDatav3.AddRaw(wxT("item") + wxString::Format(wxT("%i"), ItemSeek) + wxT(".URL"), wxSPropertySeg2);
1353                                 ContactDatav3.AddRaw(wxT("item") + wxString::Format(wxT("%i"), ItemSeek) + wxT(".X-ABLabel"), _("URL"));
1354                                 ContactDatav3.AddRaw(wxT("item") + wxString::Format(wxT("%i"), ItemSeek) + wxT(".X-VCARD4-URL;") + ContactLine.Mid(intPrevValue, ((QuoteBreakPoint + 1) - (intPrevValue + 1))), wxSPropertySeg2);
1355                                 
1356                         }
1357                         
1358                         ItemSeek++;
1359                 
1360                 } else if (wxSProperty == wxT("TITLE")) {
1361                 
1362                         int intPropertyLen = wxSPropertySeg1.Len();
1363                         std::map<int, int> SplitPoints;
1364                         std::map<int, int> SplitLength;
1365                         std::map<int, int>::iterator SLiter;                    
1366                         wxString PropertyData;
1367                         wxString PropertyName;
1368                         wxString PropertyValue;
1369                         wxString PropertyTokens;
1370                         bool AfterFirstToken = FALSE;
1371                         bool FirstToken = TRUE;                 
1372                         int intSplitsFound = 0;
1373                         int intSplitSize = 0;
1374                         int intPrevValue = 7;
1375                         int intPref = 0;                        
1376                         int intType = 0;
1377                         int intSplitSeek = 0;
1379                         
1380                         intPrevValue = 6;
1381                         
1382                         // Look for type before continuing.
1383                         
1384                         if (TitleFirst == FALSE){
1386                                 ContactDatav3.AddRaw(wxT("TITLE"), wxSPropertySeg2);
1387                                 
1388                                 if (((QuoteBreakPoint + 1) - intPrevValue) <= 0){
1389         
1390                                 } else {
1391                                 
1392                                         ContactDatav3.AddRaw(wxT("X-VCARD4-TITLE;X-FIRST=TRUE;") 
1393                                                 + ContactLine.Mid(intPrevValue, ((QuoteBreakPoint + 1) - (intPrevValue + 1))), wxT(""));
1394                                 
1395                                 }
1396                                 TitleFirst = TRUE;
1397                                 ItemSeek++;
1398                         
1399                         } else {
1400                         
1401                                 if (((QuoteBreakPoint + 1) - intPrevValue) <= 0){
1403                                         ContactDatav3.AddRaw(wxT("X-VCARD4-TITLE"), wxSPropertySeg2);
1404         
1405                                 } else {
1406                                 
1407                                         ContactDatav3.AddRaw(wxT("X-VCARD4-TITLE;") + ContactLine.Mid(intPrevValue, ((QuoteBreakPoint + 1) - (intPrevValue + 1))) + wxT(":"), 
1408                                                 wxSPropertySeg2);
1409                                 
1410                                 }
1411                         
1412                         }
1413                         
1414                 } else if (wxSProperty == wxT("ROLE")) {
1415                 
1416                         int intPropertyLen = wxSPropertySeg1.Len();
1417                         std::map<int, int> SplitPoints;
1418                         std::map<int, int> SplitLength;
1419                         std::map<int, int>::iterator SLiter;                    
1420                         wxString PropertyData;
1421                         wxString PropertyName;
1422                         wxString PropertyValue;
1423                         wxString PropertyTokens;
1424                         bool AfterFirstToken = FALSE;
1425                         bool FirstToken = TRUE;                 
1426                         int intSplitsFound = 0;
1427                         int intSplitSize = 0;
1428                         int intPrevValue = 6;
1429                         int intPref = 0;                        
1430                         int intType = 0;
1431                         int intSplitSeek = 0;
1433                         
1434                         intPrevValue = 5;
1435                         
1436                         if (((QuoteBreakPoint + 1) - intPrevValue) <= 0){
1438                                 ContactDatav3.AddRaw(wxT("X-VCARD4-ROLE"), wxSPropertySeg2);
1440                         } else {
1441                                         
1442                                 ContactDatav3.AddRaw(wxT("X-VCARD4-ROLE;") + ContactLine.Mid(intPrevValue, ((QuoteBreakPoint + 1) - (intPrevValue + 1))), wxSPropertySeg2);
1443                                 
1444                         }
1445                         
1446                 } else if (wxSProperty == wxT("ORG")) {
1447                 
1448                         int intPropertyLen = wxSPropertySeg1.Len();
1449                         std::map<int, int> SplitPoints;
1450                         std::map<int, int> SplitLength;
1451                         std::map<int, int>::iterator SLiter;                    
1452                         wxString PropertyData;
1453                         wxString PropertyName;
1454                         wxString PropertyValue;
1455                         wxString PropertyTokens;
1456                         bool AfterFirstToken = FALSE;
1457                         bool FirstToken = TRUE;                 
1458                         int intSplitsFound = 0;
1459                         int intSplitSize = 0;
1460                         int intPrevValue = 5;
1461                         int intPref = 0;
1462                         int intType = 0;
1463                         int intSplitSeek = 0;
1465                         
1466                         intPrevValue = 4;
1467                         
1468                         if (OrganisationFirst == FALSE){
1470                                 ContactDatav3.AddRaw(wxT("ORG"), wxSPropertySeg2);
1471                                 
1472                                 if (((QuoteBreakPoint + 1) - intPrevValue) <= 0){
1473         
1474                                 } else {
1475                                 
1476                                         ContactDatav3.AddRaw(wxT("X-VCARD4-ORG;X-FIRST=TRUE;") 
1477                                                 + ContactLine.Mid(intPrevValue, ((QuoteBreakPoint + 1) - (intPrevValue + 1))), wxT(""));
1478                                 
1479                                 }
1480                                 OrganisationFirst = TRUE;
1481                                 ItemSeek++;
1482                         
1483                         } else {
1484                         
1485                                 if (((QuoteBreakPoint + 1) - intPrevValue) <= 0){
1487                                         ContactDatav3.AddRaw(wxT("X-VCARD4-ORG"), wxSPropertySeg2);
1488         
1489                                 } else {
1490                                 
1491                                         ContactDatav3.AddRaw(wxT("X-VCARD4-ORG;") + ContactLine.Mid(intPrevValue, ((QuoteBreakPoint + 1) - (intPrevValue + 1))) + wxT(":"), 
1492                                                 wxSPropertySeg2);
1493                                 
1494                                 }
1495                         
1496                         }
1497                         
1498                 } else if (wxSProperty == wxT("NOTE")) {
1499                 
1500                         int intPropertyLen = wxSPropertySeg1.Len();
1501                         std::map<int, int> SplitPoints;
1502                         std::map<int, int> SplitLength;
1503                         std::map<int, int>::iterator SLiter;                    
1504                         wxString PropertyData;
1505                         wxString PropertyName;
1506                         wxString PropertyValue;
1507                         wxString PropertyTokens;
1508                         bool AfterFirstToken = FALSE;
1509                         bool FirstToken = TRUE;                 
1510                         int intSplitsFound = 0;
1511                         int intSplitSize = 0;
1512                         int intPrevValue = 6;
1513                         int intPref = 0;                        
1514                         int intType = 0;
1515                         int intSplitSeek = 0;
1517                         
1518                         intPrevValue = 5;
1519                         
1520                         if (NoteFirst == FALSE){
1522                                 ContactDatav3.AddRaw(wxT("NOTE"), wxSPropertySeg2);
1523                                 
1524                                 if (((QuoteBreakPoint + 1) - intPrevValue) <= 0){
1525         
1526                                 } else {
1527                                 
1528                                         ContactDatav3.AddRaw(wxT("X-VCARD4-NOTE;X-FIRST=TRUE;") 
1529                                                 + ContactLine.Mid(intPrevValue, ((QuoteBreakPoint + 1) - (intPrevValue + 1))), wxT(""));
1530                                                                 
1531                                 }
1532                                 NoteFirst = TRUE;
1533                                 ItemSeek++;
1534                         
1535                         } else {
1536                         
1537                                 if (((QuoteBreakPoint + 1) - intPrevValue) <= 0){
1539                                         ContactDatav3.AddRaw(wxT("X-VCARD4-NOTE"), wxSPropertySeg2);
1540         
1541                                 } else {
1542                                 
1543                                         ContactDatav3.AddRaw(wxT("X-VCARD4-NOTE;") + ContactLine.Mid(intPrevValue, ((QuoteBreakPoint + 1) - (intPrevValue + 1))) + wxT(":"), 
1544                                                 wxSPropertySeg2);
1545                                 
1546                                 }
1547                         
1548                         }
1549                         
1550                 } else if (wxSProperty == wxT("CATEGORIES")) {
1551                 
1552                         int intPropertyLen = wxSPropertySeg1.Len();
1553                         std::map<int, int> SplitPoints;
1554                         std::map<int, int> SplitLength;
1555                         std::map<int, int>::iterator SLiter;                    
1556                         wxString PropertyData;
1557                         wxString PropertyName;
1558                         wxString PropertyValue;
1559                         wxString PropertyTokens;
1560                         wxString PropertyType;
1561                         bool AfterFirstToken = FALSE;
1562                         bool FirstToken = TRUE;                 
1563                         int intSplitsFound = 0;
1564                         int intSplitSize = 0;
1565                         int intPrevValue = 12;
1566                         int intPref = 0;                        
1567                         int intType = 0;
1568                         int intSplitSeek = 0;
1570                         
1571                         intPrevValue = 11;
1572                         
1573                     if (((QuoteBreakPoint + 1) - intPrevValue) <= 0){
1574                         
1575                         ContactDatav3.AddRaw(wxT("X-VCARD4-CATEGORIES"), wxSPropertySeg2);
1576    
1577                     } else {
1578                         
1579                         ContactDatav3.AddRaw(wxT("X-VCARD4-CATEGORIES;") + ContactLine.Mid(intPrevValue, ((QuoteBreakPoint + 1) - (intPrevValue + 1))), wxSPropertySeg2);
1581                     }
1582                         
1583                 } else if (wxSProperty == wxT("PHOTO")) {
1584                 
1585                         int intPropertyLen = wxSPropertySeg1.Len();
1586                         std::map<int, int> SplitPoints;
1587                         std::map<int, int> SplitLength;
1588                         std::map<int, int>::iterator SLiter;                    
1589                         wxString PropertyData;
1590                         wxString PropertyName;
1591                         wxString PropertyValue;
1592                         wxString PropertyTokens;
1593                         bool FirstToken = TRUE;
1594                         int intSplitsFound = 0;
1595                         int intSplitSize = 0;
1596                         int intPrevValue = 7;
1597                         int intPref = 0;                        
1598                         int intType = 0;
1599                         int intSplitSeek = 0;
1601                         
1602                         intPropertyLen = wxSPropertySeg2.Len();
1603                         SplitPoints.clear();
1604                         SplitLength.clear();
1605                         intSplitsFound = 0;
1606                         intSplitSize = 0;                       
1607                         
1608                         CaptureString(&wxSPropertySeg2, FALSE);
1609                         
1610                         for (int i = 0; i <= intPropertyLen; i++){
1611                 
1612                                 intSplitSize++;
1613                         
1614                                 if (wxSPropertySeg2.Mid(i, 1) == wxT(";")){
1615                         
1616                                         intSplitsFound++;
1617                                         SplitPoints.insert(std::make_pair(intSplitsFound, (i + 1)));
1618                                         
1619                                         if (intSplitsFound == 6){ 
1620                                         
1621                                                 SplitLength.insert(std::make_pair(intSplitsFound, (intSplitSize - 1)));
1622                                                 break; 
1623                                                 
1624                                         } else {
1625                                         
1626                                                 SplitLength.insert(std::make_pair(intSplitsFound, (intSplitSize - 1)));
1627                                         
1628                                         }
1629                                         
1630                                         intSplitSize = 0;                                       
1631                         
1632                                 }
1633                 
1634                         }
1635                         
1636                         wxString wxSPhotoURI;
1637                         wxString wxSPhotoMIME;
1638                         wxString wxSPhotoEncoding;
1639                         wxString wxSPhotoData;
1640                         std::string base64enc;
1641                         
1642                         if (intSplitsFound = 0){
1643                         
1644                         } else {
1645                         
1646                                 std::map<int, int>::iterator striter;
1647                         
1648                                 striter = SplitLength.find(1);
1649                         
1650                                 wxStringTokenizer wSTDataType(wxSPropertySeg2.Mid(0, striter->second), wxT(":"));
1651                         
1652                                 while (wSTDataType.HasMoreTokens() == TRUE){
1653                                 
1654                                         wxSPhotoURI = wSTDataType.GetNextToken();
1655                                         wxSPhotoMIME = wSTDataType.GetNextToken();
1656                                         break;
1657                                 
1658                                 }                       
1659                         
1660                                 wxStringTokenizer wSTDataInfo(wxSPropertySeg2.Mid((striter->second + 1)), wxT(","));                    
1661                         
1662                                 while (wSTDataInfo.HasMoreTokens() == TRUE){
1663                                 
1664                                         wxSPhotoEncoding = wSTDataInfo.GetNextToken();
1665                                         wxSPhotoData = wSTDataInfo.GetNextToken();                                      
1666                                         base64enc = wxSPhotoData.mb_str();
1667                                         break;
1668                                 
1669                                 }
1670                         
1671                         }
1672                         
1673                         
1674                         if (PhotoFirst == FALSE){
1676                                 bool PhotoKeepData = FALSE;
1678                                 wxString wxSPhotoMIMEF;
1679                                 
1680                                 if (wxSPhotoMIME == wxT("image/png")){
1681                                         wxSPhotoMIMEF = wxT("PNG");
1682                                 } else if (wxSPhotoMIME == wxT("image/jpeg")){
1683                                         wxSPhotoMIMEF = wxT("JPEG");
1684                                 } else if (wxSPhotoMIME == wxT("image/gif")){
1685                                         wxSPhotoMIMEF = wxT("GIF");
1686                                 } else if (wxSPhotoMIME == wxT("image/bmp")){
1687                                         wxSPhotoMIMEF = wxT("BMP");                     
1688                                 } else {
1689                                         wxSPhotoMIMEF = wxT("UNKNOWN");
1690                                         PhotoKeepData = TRUE;
1691                                 }
1693                                 ContactDatav3.AddRaw(wxT("PHOTO;ENCODING=b;TYPE=") + wxSPhotoMIMEF, wxSPhotoData);
1695                                 if (((QuoteBreakPoint + 1) - intPrevValue) <= 0){
1696         
1697                                 } else {
1699                                         if (PhotoKeepData == TRUE){
1700                                 
1701                                                 ContactDatav3.AddRaw(wxT("X-VCARD4-PHOTO;X-FIRST=TRUE;") 
1702                                                         + ContactLine.Mid((intPrevValue - 1), ((QuoteBreakPoint + 1) - (intPrevValue))), wxSPropertySeg2);
1703                                                 
1704                                         } else {
1706                                                 ContactDatav3.AddRaw(wxT("X-VCARD4-PHOTO;X-FIRST=TRUE;") 
1707                                                         + ContactLine.Mid((intPrevValue - 1), ((QuoteBreakPoint + 1) - (intPrevValue))), wxT(""));
1708                                         
1709                                         }
1710                                 
1711                                 }
1712                                 PhotoFirst = TRUE;
1713                                 ItemSeek++;
1714                         
1715                         } else {
1716                         
1717                                 if (((QuoteBreakPoint + 1) - intPrevValue) <= 0){
1719                                         ContactDatav3.AddRaw(wxT("X-VCARD4-PHOTO"), wxSPropertySeg2);
1720         
1721                                 } else {
1722                                 
1723                                         ContactDatav3.AddRaw(wxT("X-VCARD4-PHOTO;") + ContactLine.Mid(intPrevValue, ((QuoteBreakPoint + 1) - (intPrevValue + 1))) + wxT(":"), 
1724                                                 wxSPropertySeg2);
1725                                 }
1726                         
1727                         }
1728                         
1729                 } else if (wxSProperty == wxT("LOGO")) {
1730                 
1731                         int intPropertyLen = wxSPropertySeg1.Len();
1732                         std::map<int, int> SplitPoints;
1733                         std::map<int, int> SplitLength;
1734                         std::map<int, int>::iterator SLiter;                    
1735                         wxString PropertyData;
1736                         wxString PropertyName;
1737                         wxString PropertyValue;
1738                         wxString PropertyTokens;
1739                         bool FirstToken = TRUE;
1740                         int intSplitsFound = 0;
1741                         int intSplitSize = 0;
1742                         int intPrevValue = 6;
1743                         int intPref = 0;                        
1744                         int intType = 0;
1745                         int intSplitSeek = 0;
1747                         
1748                         intPrevValue = 5;
1749                         
1750                         if (((QuoteBreakPoint + 1) - intPrevValue) <= 0){
1751                         
1752                                 ContactDatav3.AddRaw(wxT("X-VCARD4-LOGO"), wxSPropertySeg2);
1754                         } else {
1755                         
1756                                 ContactDatav3.AddRaw(wxT("X-VCARD4-LOGO;") + ContactLine.Mid(intPrevValue, ((QuoteBreakPoint + 1) - (intPrevValue + 1))), wxSPropertySeg2);
1757                         
1758                         }
1759                         
1760                 } else if (wxSProperty == wxT("SOUND")) {
1761                 
1762                         int intPropertyLen = wxSPropertySeg1.Len();
1763                         std::map<int, int> SplitPoints;
1764                         std::map<int, int> SplitLength;
1765                         std::map<int, int>::iterator SLiter;                    
1766                         wxString PropertyData;
1767                         wxString PropertyName;
1768                         wxString PropertyValue;
1769                         wxString PropertyTokens;
1770                         bool FirstToken = TRUE;
1771                         int intSplitsFound = 0;
1772                         int intSplitSize = 0;
1773                         int intPrevValue = 7;
1774                         int intPref = 0;                        
1775                         int intType = 0;
1776                         int intSplitSeek = 0;
1778                         
1779                         intPrevValue = 6;
1780                         
1781                         if (((QuoteBreakPoint + 1) - intPrevValue) <= 0){
1782                         
1783                                 ContactDatav3.AddRaw(wxT("X-VCARD4-SOUND"), wxSPropertySeg2);
1785                         } else {
1786                         
1787                                 ContactDatav3.AddRaw(wxT("X-VCARD4-SOUND;") + ContactLine.Mid(intPrevValue, ((QuoteBreakPoint + 1) - (intPrevValue + 1))), wxSPropertySeg2);
1788                         
1789                         }
1790                         
1791                 } else if (wxSProperty == wxT("CALURI")){
1792                 
1793                         int intPropertyLen = wxSPropertySeg1.Len();
1794                         std::map<int, int> SplitPoints;
1795                         std::map<int, int> SplitLength;
1796                         std::map<int, int>::iterator SLiter;                    
1797                         wxString PropertyData;
1798                         wxString PropertyName;
1799                         wxString PropertyValue;
1800                         wxString PropertyTokens;
1801                         bool AfterFirstToken = FALSE;
1802                         bool FirstToken = TRUE;                 
1803                         int intSplitsFound = 0;
1804                         int intSplitSize = 0;
1805                         int intPrevValue = 8;
1806                         int intPref = 0;                        
1807                         int intType = 0;
1808                         int intSplitSeek = 0;
1810                         
1811                         intPrevValue = 7;
1812                         
1813                     if (((QuoteBreakPoint + 1) - intPrevValue) <= 0){
1814                         
1815                         ContactDatav3.AddRaw(wxT("X-VCARD4-CALURI"), wxSPropertySeg2);
1817                     } else {
1818                         
1819                         ContactDatav3.AddRaw(wxT("X-VCARD4-CALURI;") + ContactLine.Mid(intPrevValue, ((QuoteBreakPoint + 1) - (intPrevValue + 1))), wxSPropertySeg2);
1821                     }
1822                 
1823                 } else if (wxSProperty == wxT("CALADRURI")){
1824                 
1825                         int intPropertyLen = wxSPropertySeg1.Len();
1826                         std::map<int, int> SplitPoints;
1827                         std::map<int, int> SplitLength;
1828                         std::map<int, int>::iterator SLiter;                    
1829                         wxString PropertyData;
1830                         wxString PropertyName;
1831                         wxString PropertyValue;
1832                         wxString PropertyTokens;
1833                         bool AfterFirstToken = FALSE;
1834                         bool FirstToken = TRUE;                 
1835                         int intSplitsFound = 0;
1836                         int intSplitSize = 0;
1837                         int intPrevValue = 11;
1838                         int intPref = 0;                        
1839                         int intType = 0;
1840                         int intSplitSeek = 0;
1842                         
1843                         intPrevValue = 10;
1844                         
1845                     if (((QuoteBreakPoint + 1) - intPrevValue) <= 0){
1846                         
1847                         ContactDatav3.AddRaw(wxT("X-VCARD4-CALADRURI"), wxSPropertySeg2);
1849                     } else {
1850                         
1851                         ContactDatav3.AddRaw(wxT("X-VCARD4-CALADRURI;") + ContactLine.Mid(intPrevValue, ((QuoteBreakPoint + 1) - (intPrevValue + 1))), wxSPropertySeg2);
1853                     }
1854                 
1855                 } else if (wxSProperty == wxT("FBURL")){
1856                 
1857                         int intPropertyLen = wxSPropertySeg1.Len();
1858                         std::map<int, int> SplitPoints;
1859                         std::map<int, int> SplitLength;
1860                         std::map<int, int>::iterator SLiter;                    
1861                         wxString PropertyData;
1862                         wxString PropertyName;
1863                         wxString PropertyValue;
1864                         wxString PropertyTokens;
1865                         bool AfterFirstToken = FALSE;
1866                         bool FirstToken = TRUE;                 
1867                         int intSplitsFound = 0;
1868                         int intSplitSize = 0;
1869                         int intPrevValue = 7;
1870                         int intPref = 0;                        
1871                         int intType = 0;
1872                         int intSplitSeek = 0;
1874                         
1875                         intPrevValue = 6;
1876                         
1877                     if (((QuoteBreakPoint + 1) - intPrevValue) <= 0){
1878                         
1879                         ContactDatav3.AddRaw(wxT("X-VCARD4-FBURL"), wxSPropertySeg2);
1881                     } else {
1882                         
1883                         ContactDatav3.AddRaw(wxT("X-VCARD4-FBURL;") + ContactLine.Mid(intPrevValue, ((QuoteBreakPoint + 1) - (intPrevValue + 1))), wxSPropertySeg2);
1885                     }
1886                 
1887                 } else if (wxSProperty == wxT("KEY")){
1888                 
1889                         int intPropertyLen = wxSPropertySeg1.Len();
1890                         std::map<int, int> SplitPoints;
1891                         std::map<int, int> SplitLength;
1892                         std::map<int, int>::iterator SLiter;                    
1893                         wxString PropertyData;
1894                         wxString PropertyName;
1895                         wxString PropertyValue;
1896                         wxString PropertyTokens;
1897                         bool AfterFirstToken = FALSE;
1898                         bool FirstToken = TRUE;
1899                         int intSplitsFound = 0;
1900                         int intSplitSize = 0;
1901                         int intPrevValue = 5;
1902                         int intPref = 0;                        
1903                         int intType = 0;
1904                         int intSplitSeek = 0;
1906                         
1907                         intPrevValue = 4;
1908                                                 
1909                     if (((QuoteBreakPoint + 1) - intPrevValue) <= 0){
1910                         
1911                         ContactDatav3.AddRaw(wxT("X-VCARD4-KEY"), wxSPropertySeg2);
1913                     } else {
1914                         
1915                         ContactDatav3.AddRaw(wxT("X-VCARD4-KEY;") + ContactLine.Mid(intPrevValue, ((QuoteBreakPoint + 1) - (intPrevValue + 1))), wxSPropertySeg2);
1917                     }
1918                 
1919                 } else if (wxSProperty == wxT("UID")){
1920                 
1921                         ContactDatav3.AddRaw(wxT("UID"), wxSPropertySeg2);
1922                 
1923                 } else if (wxSProperty.Mid(0, 3) == wxT("VND")){
1924                 
1925                         // Split the Vendor three ways.
1926                         
1927                         wxStringTokenizer wSTVendorDetails(wxSPropertySeg1, wxT("-"));
1928                         
1929                         wxString wxSVNDID;
1930                         wxString wxSVNDPropName;
1932                         
1933                         int intPrevValue = (wxSProperty.Len() + 1);
1935                         while (wSTVendorDetails.HasMoreTokens() == TRUE){
1936                         
1937                                 wSTVendorDetails.GetNextToken();
1938                                 wxSVNDID = wSTVendorDetails.GetNextToken();
1939                                 wxSVNDPropName = wSTVendorDetails.GetNextToken();
1940                                 break;
1941                         
1942                         }
1944                     if (((QuoteBreakPoint + 1) - intPrevValue) <= 0){
1945                         
1946                         ContactDatav3.AddRaw(wxT("X-VCARD4-") + wxSProperty, wxSPropertySeg2);
1948                     } else {
1949                         
1950                         ContactDatav3.AddRaw(wxT("X-VCARD4-") + wxSProperty + wxT(";") + ContactLine.Mid(intPrevValue, ((QuoteBreakPoint + 1) - (intPrevValue + 1))), wxSPropertySeg2);
1952                     }
1953                 
1954                 } else if (wxSProperty.Mid(0, 2) == wxT("X-")){
1955                 
1957                         
1958                         int intPrevValue = (wxSProperty.Len() + 1);
1959                         
1960                     if (((QuoteBreakPoint + 1) - intPrevValue) <= 0){
1961                         
1962                         ContactDatav3.AddRaw(wxSProperty, wxSPropertySeg2);
1964                     } else {
1965                         
1966                         ContactDatav3.AddRaw(wxSProperty + wxT(";") + ContactLine.Mid(intPrevValue, ((QuoteBreakPoint + 1) - (intPrevValue + 1))), wxSPropertySeg2);
1968                     }
1969                         
1970                 }
1971                 
1972                 // Reset the variables.
1973                 
1974                 QuoteMode = FALSE;
1975                 PropertyFind = TRUE;
1976                 ExtraLineSeek = TRUE;
1977                 ContactLineLen = 0;
1978                 QuoteBreakPoint = 0;
1979                 ContactLine.Clear();
1980                 wxSProperty.Clear();    
1981         
1982         }
1983         
1984         ContactDatav3.AddRaw(wxT("END"), wxT("VCARD"));
1985         *wxSData = ContactDatav3.WriteString();
1986         
1987         return TRUE;
1988         
1991 bool vCard34Conv::ConvertToV4(wxString *wxSData, vCard *vCardOut){
1992         
1993         std::map<int, wxString> ContactFileLines;
1994         std::map<int, bool> ContactFileProcessed;
1995         std::map<int, bool> ContactFileProcessedWorking;
1996         std::map<int, wxString>::iterator striter;
1997         std::map<int,bool>::iterator iterbool;
1998         std::map<int,bool>::iterator iterboolsub;
1999         wxString ContactLineRec;
2001         // Process the received data.
2002         
2003         wxStringTokenizer wSTContactFileLines(*wxSData, wxT("\r\n"));
2005         int ContactLineSeek = 0;
2007         while (wSTContactFileLines.HasMoreTokens() == TRUE){
2009                 ContactLineRec = wSTContactFileLines.GetNextToken();
2010                 ContactFileLines.insert(std::make_pair(ContactLineSeek, ContactLineRec));
2011                 ContactFileProcessed.insert(std::make_pair(ContactLineSeek, FALSE));
2012                 ContactLineSeek++;              
2013         
2014         }
2015         
2016         bool QuoteMode = FALSE;
2017         bool PropertyFind = TRUE;
2018         bool HasExtraNicknames = FALSE;
2019         bool IgnoreGender = FALSE;
2020         bool ExtraLineSeek = TRUE;
2021         bool ExtraLineSeekSub = TRUE;
2022         bool BirthdayProcessed = FALSE;
2023         bool AnniversaryProcessed = FALSE;
2024         bool FNProcessed = FALSE;
2025         bool GenderProcessed = FALSE;
2026         bool NameProcessed = FALSE;
2027         bool FNFirst = FALSE;
2028         bool NicknameFirst = FALSE;
2029         bool TitleFirst = FALSE;
2030         bool OrganisationFirst = FALSE;
2031         bool NoteFirst = FALSE;
2032         bool PhotoFirst = FALSE;
2033         bool LogoFirst = FALSE;
2034         bool NameFirst = FALSE;
2035         bool FoundData = FALSE;
2036         int intExtraNickname = 0;
2037         wxString wxSProperty;
2038         wxString wxSPropertyVCARD4;
2039         wxString wxSPropertySeg1;
2040         wxString wxSPropertySeg2;
2041         wxString wxSPropertyNextLine;
2042         wxString ContactLine;
2043         wxString ContactLineSub;
2044         wxString PropertyName;
2045         wxString PropertyValue;
2046         wxString PropertyDataStr;
2047         int ContactLineLen = 0;
2048         int ContactLineSubLen = 0;
2049         int QuoteBreakPoint = 0;
2050         int intPrevValueSub = 0;
2052         std::map<wxString, wxString> PropertyData;
2053         std::map<wxString, bool> PropertyLock;
2054         std::map<wxString, wxString> TempPropertyData;
2055         std::map<wxString, bool> TempPropertyLock;
2056         std::map<int, int> TempSplitPoints;
2057         std::map<int, int> TempSplitLength;
2058         std::map<int, int>::iterator SLiter;
2060         wxString PropertFindSub;
2061         wxString wxSPropertySub;
2062         wxString wxSPropertySeg1Sub;
2063         wxString wxSPropertySeg2Sub;
2064         wxString wxSPropertyValues;
2065         wxString wxSPropertyData;
2066         wxString wxSPropertyNameConv;
2067         wxString wxSPropertyXVCard4Value;
2068         wxString ItemProcString;
2069         
2070         bool XVCard4Value = FALSE;
2071         bool VCard3Value = FALSE;
2072         bool SeekItemData = FALSE;
2073         
2074         wxString strVer;
2075     
2076         // Setup the version string.
2077         
2078         strVer.Append(wxT("-//Xestia//Address Book Version "));
2079         strVer.Append(wxT(XSDAB_VERSION));
2080         strVer.Append(wxT("//KW"));
2081         
2082         vCardOut->AddRaw(wxT("BEGIN"), wxT("VCARD"));
2083         vCardOut->AddRaw(wxT("VERSION"), wxT("4.0"));
2084         vCardOut->AddRaw(wxT("PRODID"), strVer);
2085         
2086                 // FN
2087                 // NICKNAME
2088                 // TITLE
2089                 // ORG
2090                 // NOTE
2091                 // PHOTO
2092                 
2093         // Process the properties which have X-FIRST.
2094         
2095         // Clone the ContactFileProcessed into ContactFileProcessedWorking.
2097         ContactFileProcessedWorking.insert(ContactFileProcessed.begin(), ContactFileProcessed.end());
2099         for (std::map<int,wxString>::iterator iter = ContactFileLines.begin(); 
2100          iter != ContactFileLines.end(); ++iter){
2101          
2102                 ExtraLineSeek = TRUE;
2104                 iterbool = ContactFileProcessed.find(iter->first);
2105                 
2106                 ContactLine = iter->second;
2107                 
2108                 // Ignore certain variables as they are not needed.
2109                 
2110                 if (ContactLine == wxT("BEGIN:VCARD") || 
2111                 ContactLine == wxT("END:VCARD") || 
2112                 ContactLine.Mid(0, 8) == wxT("VERSION:") || 
2113                 ContactLine.Mid(0, 7) == wxT("PRODID:") || 
2114                 ContactLine.Mid(0, 5) == wxT("X-AIM") || 
2115                 ContactLine.Mid(0, 5) == wxT("X-MSN") || 
2116                 ContactLine.Mid(0, 5) == wxT("X-ICQ") || 
2117                 ContactLine.Mid(0, 10) == wxT("X-GADUGADU") || 
2118                 ContactLine.Mid(0, 7) == wxT("X-YAHOO") || 
2119                 ContactLine.Mid(0, 7) == wxT("X-SKYPE") || 
2120                 ContactLine.Mid(0, 8) == wxT("X-JABBER") ||
2121                 ContactLine.Mid(0, 4) == wxT("REV:")){
2122                         
2123                         iterbool->second = TRUE;
2124                         continue;
2125                         
2126                 }
2127                 
2128                 if (iterbool->second == TRUE){
2129                         
2130                         continue;
2131                         
2132                 }
2133                 
2134                 if (ContactLine.Mid(0, 1) == wxT(" ") || ContactLine.Mid(0, 1) == wxT("\t")){
2135                 
2136                         continue;
2137                 
2138                 }
2139         
2140                 if (ContactLine.Mid(0, 4) == wxT("item")){
2141                 
2142                         // Line is a itemn... so ignore.
2143                 
2144                         continue;
2145                 
2146                 }
2147                 
2148                 std::map<int,int> DataLineProcess;
2149                 std::map<int, bool>::iterator DLSLiter;
2150                 std::map<int,int> DataLineProcessOriginal;
2151                 int DataLineSeek = 0;
2152                 int DataLineSeekOrig = 0;
2154                 std::map<int,wxString>::iterator itersub = iter;
2155                 DataLineProcessOriginal.insert(std::make_pair(DataLineSeekOrig, iterbool->first));
2156                 DataLineSeekOrig++;
2158                 while (ExtraLineSeek == TRUE){
2159                 
2160                         // Check if there is extra data on the next line 
2161                         // (indicated by space or tab at the start) and add data.
2162                 
2163                         itersub++;
2165                         if (itersub == ContactFileLines.end()){
2167                                 break;
2169                         }
2171                         iterboolsub = ContactFileProcessed.find(itersub->first);
2173                         if (iterboolsub == ContactFileProcessed.end()){
2174                         
2175                                 break;
2176                         
2177                         }
2178                         
2179                         if (iterboolsub->second == TRUE){
2180                         
2181                                 continue;
2182                         
2183                         }               
2184                 
2185                         wxSPropertyNextLine = itersub->second;
2186                 
2187                         if (wxSPropertyNextLine.Mid(0, 1) == wxT(" ") || wxSPropertyNextLine.Mid(0, 1) == wxT("\t")){
2188                 
2189                                 wxSPropertyNextLine.Remove(0, 1);
2190                                 //wxSPropertyNextLine.Trim(FALSE);
2191                                 //ContactLine.Trim();
2192                                 ContactLine.Append(wxSPropertyNextLine);
2193                                 DataLineProcessOriginal.insert(std::make_pair(DataLineSeekOrig, iterboolsub->first));
2194                                 DataLineSeekOrig++;
2195                                 //iterboolsub->second = TRUE;
2196                 
2197                         } else {
2198                         
2199                                 ExtraLineSeek = FALSE;
2200                         
2201                         }
2202                 
2203                 }
2204                 
2205                 ContactLineLen = ContactLine.Len();
2206                 
2207                 for (int i = 0; i <= ContactLineLen; i++){
2208                 
2209                         if ((ContactLine.Mid(i, 1) == wxT(";") || ContactLine.Mid(i, 1) == wxT(":")) && PropertyFind == TRUE){
2210                         
2211                                 PropertyFind = FALSE;
2212                         
2213                         } else if (PropertyFind == TRUE){
2214                         
2215                                 wxSProperty.Append(ContactLine.Mid(i, 1));
2216                         
2217                         }               
2218                 
2219                         if (ContactLine.Mid(i, 1) == wxT("\"")){
2220                         
2221                                 if (QuoteMode == TRUE){
2222                                 
2223                                         QuoteMode = FALSE;
2224                                 
2225                                 } else {
2226                         
2227                                         QuoteMode = TRUE;
2228                                         
2229                                 }
2230                         
2231                         }
2232                         
2233                         if (ContactLine.Mid(i, 1) == wxT(":") && ContactLine.Mid((i - 1), 1) != wxT("\\") && QuoteMode == FALSE){
2234                         
2235                                 QuoteBreakPoint = i;
2236                                 break;
2237                         
2238                         }
2239                 
2240                 }
2242                 wxSPropertySeg1 = ContactLine.Mid(0, QuoteBreakPoint);
2243                 wxSPropertySeg2 = ContactLine.Mid((QuoteBreakPoint + 1));
2245                 wxStringTokenizer wxSPropertySegSplit(wxSPropertySeg1, wxT(";"));
2246                 wxSProperty = wxSPropertySegSplit.GetNextToken();
2247                         
2248                 // Check what type of property it is.
2249                 
2250                 FoundData = FALSE;
2251                 
2252                 if ((wxSProperty == wxT("PHOTO") && PhotoFirst == FALSE) ||
2253                 (wxSProperty == wxT("NICKNAME") && NicknameFirst == FALSE) || 
2254                 (wxSProperty == wxT("TITLE") && TitleFirst == FALSE) || 
2255                 (wxSProperty == wxT("FN") && FNFirst == FALSE) || 
2256                 (wxSProperty == wxT("ORG") && OrganisationFirst == FALSE) ||
2257                 (wxSProperty == wxT("NOTE") && NoteFirst == FALSE)){
2258                         
2259                         wxSPropertyVCARD4 = wxT("X-VCARD4-") + wxSProperty;
2260                         intPrevValueSub = (wxSPropertyVCARD4.Len() + 2);
2261                         
2262                         for (std::map<int,wxString>::iterator itersub = ContactFileLines.begin(); 
2263                         itersub != ContactFileLines.end(); ++itersub){
2264                 
2265                                 //DataLineProcess = DataLineProcessOriginal;
2266                                 //DataLineSeek = DataLineSeekOrig;
2267                 
2268                                 ContactLineSub = itersub->second;
2269                 
2270                                 ExtraLineSeekSub = TRUE;
2272                                 iterboolsub = ContactFileProcessed.find(itersub->first);
2273                                 std::map<int,bool>::iterator iterorig = ContactFileProcessed.find(itersub->first);
2274                                 //std::map<int,bool>::iterator itersuborig;
2275                 
2276                                 // Ignore certain variables as they are not needed.
2277                 
2278                                 if (ContactLineSub == wxT("BEGIN:VCARD") || 
2279                                 ContactLineSub == wxT("END:VCARD") || 
2280                                 ContactLineSub.Mid(0, 8) == wxT("VERSION:") || 
2281                                 ContactLineSub.Mid(0, 7) == wxT("PRODID:") || 
2282                                 ContactLineSub.Mid(0, 5) == wxT("X-AIM") || 
2283                                 ContactLineSub.Mid(0, 5) == wxT("X-MSN") || 
2284                                 ContactLineSub.Mid(0, 5) == wxT("X-ICQ") || 
2285                                 ContactLineSub.Mid(0, 10) == wxT("X-GADUGADU") || 
2286                                 ContactLineSub.Mid(0, 7) == wxT("X-YAHOO") || 
2287                                 ContactLineSub.Mid(0, 7) == wxT("X-SKYPE") || 
2288                                 ContactLineSub.Mid(0, 8) == wxT("X-JABBER") ||
2289                                 ContactLineSub.Mid(0, 4) == wxT("REV:")){
2290                         
2291                                         iterboolsub->second = TRUE;
2292                                         continue;
2293                         
2294                                 }
2295                 
2296                                 if (iterboolsub->second == TRUE){
2298                                         continue;
2299                         
2300                                 }
2301                 
2302                                 if (ContactLineSub.Mid(0, 1) == wxT(" ") || ContactLineSub.Mid(0, 1) == wxT("\t")){
2303                 
2304                                         continue;
2305                 
2306                                 }
2307         
2308                                 if (ContactLineSub.Mid(0, 4) == wxT("item")){
2309                 
2310                                         // Line is a itemn... so ignore.
2311                 
2312                                         continue;
2313                 
2314                                 }
2315                 
2316                                 //std::map<int,wxString>::iterator itersub = iter;
2317                                 
2318                                 DataLineProcess.insert(std::make_pair(DataLineSeek, itersub->first));
2319                                 DataLineSeek++;
2323                                 while (ExtraLineSeekSub == TRUE){
2325                                         if (itersub == ContactFileLines.end()){
2326                                                 ExtraLineSeekSub;
2327                                                 continue;
2328                                         } else {
2329                                                 itersub++;
2331                                         }
2333                                         iterboolsub = ContactFileProcessedWorking.find(itersub->first);
2335                                         wxSPropertyNextLine = itersub->second;
2337                                         if (wxSPropertyNextLine.Mid(0, 1) == wxT(" ") || wxSPropertyNextLine.Mid(0, 1) == wxT("\t")){
2339                                                 wxSPropertyNextLine.Remove(0, 1);
2340                                                 //wxSPropertyNextLine.Trim(FALSE);
2341                                                 //ContactLine.Trim();
2342                                                 ContactLineSub.Append(wxSPropertyNextLine);
2343                                                 //iterboolsub->second = TRUE;
2344                                                 DataLineProcess.insert(std::make_pair(DataLineSeek, itersub->first));
2345                                                 DataLineSeek++;
2347                                         } else {
2349                                                 itersub--;
2350                                                 ExtraLineSeekSub = FALSE;
2352                                         }
2354                                 }
2356                                 /*while (ExtraLineSeekSub == TRUE && iterboolsub != ContactFileProcessedWorking.end()){
2357                 
2358                                         // Check if there is extra data on the next line 
2359                                         // (indicated by space or tab at the start) and add data.
2360                 
2361                                         itersub++;
2363                                         iterboolsub = ContactFileProcessedWorking.find(itersub->first);
2364                         
2365                                         if (iterboolsub->second == TRUE){
2366                         
2367                                                 continue;
2368                         
2369                                         }
2370                         
2371                                         if (itersub == ContactFileLines.end()){
2372                         
2373                                                 break;
2374                         
2375                                         }                       
2376                 
2377                                         wxSPropertyNextLine = itersub->second;
2378                 
2379                                         if (wxSPropertyNextLine.Mid(0, 1) == wxT(" ") || wxSPropertyNextLine.Mid(0, 1) == wxT("\t")){
2380                 
2381                                                 wxSPropertyNextLine.Remove(0, 1);
2382                                                 //wxSPropertyNextLine.Trim(FALSE);
2383                                                 //ContactLine.Trim();
2384                                                 ContactLineSub.Append(wxSPropertyNextLine);
2385                                                 //iterboolsub->second = TRUE;
2386                                                 DataLineProcess.insert(std::make_pair(DataLineSeek, itersub->first));
2387                                                 DataLineSeek++;
2388                 
2389                                         } else {
2390                         
2391                                                 itersub--;
2392                                                 ExtraLineSeekSub = FALSE;
2393                         
2394                                         }
2396                                         if (iterboolsub == ContactFileProcessedWorking.end()){
2398                                                 break;
2399                                                 ExtraLineSeekSub = FALSE;
2401                                         }
2402                 
2403                                 }*/
2404                 
2405                                 ContactLineSubLen = ContactLineSub.Len();
2406                                 PropertyFind = TRUE;
2407                                 wxSPropertySub.clear();
2408                         
2409                                 for (int i = 0; i <= ContactLineSubLen; i++){
2410                 
2411                                         if ((ContactLineSub.Mid(i, 1) == wxT(";") || ContactLineSub.Mid(i, 1) == wxT(":")) && PropertyFind == TRUE){
2412                         
2413                                                 PropertyFind = FALSE;
2414                         
2415                                         } else if (PropertyFind == TRUE){
2416                         
2417                                                 wxSPropertySub.Append(ContactLineSub.Mid(i, 1));
2418                         
2419                                         }               
2420                 
2421                                         if (ContactLineSub.Mid(i, 1) == wxT("\"")){
2422                         
2423                                                 if (QuoteMode == TRUE){
2424                                  
2425                                                         QuoteMode = FALSE;
2426                                 
2427                                                 } else {
2428                         
2429                                                         QuoteMode = TRUE;
2430                                         
2431                                                 }
2432                         
2433                                         }
2434                         
2435                                         if (ContactLineSub.Mid(i, 1) == wxT(":") && ContactLineSub.Mid((i - 1), 1) != wxT("\\") && QuoteMode == FALSE){
2436                         
2437                                                 QuoteBreakPoint = i;
2438                                                 break;
2439                         
2440                                         }
2441                 
2442                                 }
2444                                 if (wxSPropertySub != wxSPropertyVCARD4){
2445                         
2446                                         wxSPropertySub.clear();
2447                                         DataLineSeek = 0;
2448                                         DataLineProcess.clear();
2449                                         continue;
2450                         
2451                                 }
2453                                 wxSPropertySeg1Sub = ContactLineSub.Mid(0, QuoteBreakPoint);
2454                                 wxSPropertySeg2Sub = ContactLineSub.Mid((QuoteBreakPoint + 1));
2456                                 // Split the property name data.
2457                         
2458                                 // Strip the X-VCARD4- from the variable.
2459                                 
2460                                 wxString wxSPropertyChopped =  wxSPropertySeg1Sub.Mid(9);
2461                         
2462                                 intPrevValueSub = (wxSProperty.Len() + 2);
2463                                 
2464                                 SplitValuesData(&wxSPropertyChopped, &TempSplitPoints, &TempSplitLength, intPrevValueSub, &TempPropertyData);
2465                                 
2466                                 // Process the splitted data into temporary property data.
2467                         
2468                                 bool FirstToken = TRUE;
2469                         
2470                                 // Look for certain property names and the X-FIRST
2471                                 // property name.
2472                                         
2473                                 bool ProcessData = FALSE;
2474                         
2475                                 // Check for X-FIRST.
2476                         
2477                                 for (std::map<wxString, wxString>::iterator xfiter = TempPropertyData.begin(); 
2478                                 xfiter != TempPropertyData.end(); ++xfiter){
2479                         
2480                                         PropertyName = xfiter->first;
2481                                         PropertyValue = xfiter->second;
2482                                                 
2483                                         if (PropertyName == wxT("X-FIRST") && PropertyValue == wxT("TRUE")){
2484                                 
2485                                                 ProcessData = TRUE;
2486                                                 
2487                                                 if (wxSProperty == wxT("PHOTO")){ PhotoFirst = TRUE; }
2488                                                 else if (wxSProperty == wxT("NICKNAME")){ NicknameFirst = TRUE; }
2489                                                 else if (wxSProperty == wxT("TITLE")){ TitleFirst = TRUE; }
2490                                                 else if (wxSProperty == wxT("FN")){ FNFirst = TRUE; }
2491                                                 else if (wxSProperty == wxT("ORG")){ OrganisationFirst = TRUE; }
2492                                                 else if (wxSProperty == wxT("NOTE")){ NoteFirst = TRUE; }
2493                                                 break;
2494                                 
2495                                         }
2496                         
2497                                 }
2498                         
2499                                 if (ProcessData == FALSE){
2500                         
2501                                         DataLineProcess.clear();
2502                                         DataLineSeek = 0;
2503                                         TempPropertyData.clear();
2504                         
2505                                 } else {
2506                                 
2507                                         wxT("PHOTODANCEMATCH!");
2508                         
2509                                         for (std::map<wxString, wxString>::iterator xfiter = TempPropertyData.begin(); 
2510                                         xfiter != TempPropertyData.end(); ++xfiter){
2511                         
2512                                                 PropertyName = xfiter->first;
2513                                                 PropertyValue = xfiter->second;
2514                         
2515                                                 if (PropertyName == wxT("X-FIRST")){
2516                                 
2517                                                         continue;
2518                                 
2519                                                 }
2520                                 
2521                                                 PropertyData.insert(std::make_pair(PropertyName, PropertyValue));
2522                                                 PropertyLock.insert(std::make_pair(PropertyName, FALSE));
2523                         
2524                                         }
2525                                 
2526                                         // Mark all lines as processed.
2527                                         
2528                                         for (std::map<int,int>::iterator dpiter = DataLineProcess.begin(); 
2529                                         dpiter != DataLineProcess.end(); ++dpiter){
2530                                         
2531                                                 DLSLiter = ContactFileProcessed.find(dpiter->second);
2532                                                 DLSLiter->second = TRUE;
2533                                         
2534                                         }
2535                                         
2536                                         for (std::map<int,int>::iterator dpoiter = DataLineProcessOriginal.begin(); 
2537                                         dpoiter != DataLineProcessOriginal.end(); ++dpoiter){
2538                                         
2539                                                 DLSLiter = ContactFileProcessed.find(dpoiter->second);
2540                                                 DLSLiter->second = TRUE;
2541                                         
2542                                         }
2543                                         
2544                                         DataLineProcess.clear();
2545                                         DataLineProcessOriginal.clear();
2546                                         DataLineSeek = 0;
2547                                         DataLineSeekOrig = 0;
2548                                         TempSplitPoints.clear();
2549                                         TempSplitLength.clear();
2550                                         TempPropertyData.clear();
2551                                         FoundData = TRUE;
2552                                         
2553                                         break;
2554                         
2555                                 }
2556                                 
2557                         }
2558                 
2559                 } else {
2560                 
2561                         wxSProperty.clear();
2562                         wxSPropertySub.Clear();
2563                         wxSPropertySeg1.Clear();
2564                         wxSPropertySeg2.Clear();
2565                         wxSPropertySeg1Sub.Clear();
2566                         wxSPropertySeg2Sub.Clear();
2567                         wxSPropertyValues.Clear();
2568                         wxSPropertyData.Clear();
2569                         wxSPropertyXVCard4Value.Clear();
2570                         wxSPropertyNameConv.Clear();
2571                         PropertyData.clear();
2572                         PropertyLock.clear();
2573                         ContactLine.clear();
2574                         ContactLineSub.clear();
2575                         DataLineProcess.clear();
2576                         DataLineProcessOriginal.clear();
2577                         TempSplitPoints.clear();
2578                         TempSplitLength.clear();
2579                         wxSPropertyVCARD4.clear();
2580                         DataLineSeek = 0;
2581                         DataLineSeekOrig = 0;
2582                         XVCard4Value = FALSE;
2583                         VCard3Value = FALSE;
2584                 
2585                 }
2586                 
2587                 if (FoundData == FALSE){
2588                 
2589                         wxSProperty.clear();
2590                         wxSPropertySub.Clear();
2591                         wxSPropertySeg1.Clear();
2592                         wxSPropertySeg2.Clear();
2593                         wxSPropertySeg1Sub.Clear();
2594                         wxSPropertySeg2Sub.Clear();
2595                         wxSPropertyValues.Clear();
2596                         wxSPropertyData.Clear();
2597                         wxSPropertyXVCard4Value.Clear();
2598                         wxSPropertyNameConv.Clear();
2599                         PropertyData.clear();
2600                         PropertyLock.clear();
2601                         ContactLine.clear();
2602                         ContactLineSub.clear();
2603                         DataLineProcess.clear();
2604                         DataLineProcessOriginal.clear();
2605                         TempSplitPoints.clear();
2606                         TempSplitLength.clear();
2607                         wxSPropertyVCARD4.clear();
2608                         DataLineSeek = 0;
2609                         DataLineSeekOrig = 0;
2610                         XVCard4Value = FALSE;
2611                         VCard3Value = FALSE;
2612                 
2613                 }
2614                 
2615                 ConvertV4PropertyProc(&wxSProperty, &wxSPropertySeg1, &wxSPropertySeg2, 
2616                         &wxSPropertyValues, &wxSPropertyData, &wxSPropertyXVCard4Value, 
2617                         &wxSPropertyNameConv, &PropertyData, &PropertyLock, FALSE, &VCard3Value, &XVCard4Value);
2618                 
2619                 wxString FinalPropertyData;
2620         
2621                 FinalPropertyData.Append(wxSPropertyNameConv);
2622         
2623                 for (std::map<wxString, wxString>::iterator striter = PropertyData.begin(); 
2624                 striter != PropertyData.end(); ++striter){
2626                         FinalPropertyData.Append(wxT(";"));             
2627                         FinalPropertyData.Append(striter->first);
2628                         FinalPropertyData.Append(wxT("="));
2629                         FinalPropertyData.Append(striter->second);
2630                 
2631                 }
2632                 
2633                 wxString FinalPropValue;
2634                 
2635                 if (wxSPropertyXVCard4Value.IsEmpty()){
2636                 
2637                         FinalPropValue = wxSPropertyData;
2638                 
2639                 } else {
2640                 
2641                         if (wxSPropertyXVCard4Value != wxSPropertyData){
2642                 
2643                                 FinalPropValue = wxSPropertyXVCard4Value;
2644                         
2645                         }
2646                 
2647                 }
2648                         
2649                 if (FinalPropertyData.IsEmpty() && FinalPropValue.IsEmpty()){
2650                 
2651                         continue;
2652                 
2653                 }
2654                 
2655                 vCardOut->AddRaw(FinalPropertyData, FinalPropValue);
2657                 wxSProperty.clear();
2658                 wxSPropertySub.Clear();
2659                 wxSPropertySeg1.Clear();
2660                 wxSPropertySeg2.Clear();
2661                 wxSPropertySeg1Sub.Clear();
2662                 wxSPropertySeg2Sub.Clear();
2663                 wxSPropertyValues.Clear();
2664                 wxSPropertyData.Clear();
2665                 wxSPropertyXVCard4Value.Clear();
2666                 wxSPropertyNameConv.Clear();
2667                 //FinalPropertyData.clear();
2668                 //FinalPropValue.clear();
2669                 PropertyData.clear();
2670                 PropertyLock.clear();
2671                 ContactLine.clear();
2672                 ContactLineSub.clear();
2673                 DataLineProcess.clear();
2674                 DataLineProcessOriginal.clear();
2675                 wxSPropertyVCARD4.clear();
2676                 DataLineSeek = 0;
2677                 DataLineSeekOrig = 0;
2678                 XVCard4Value = FALSE;
2679                 VCard3Value = FALSE;
2680         
2681         }
2682         
2683         // Process the non-itemn values.
2684         
2685         for (std::map<int,wxString>::iterator iter = ContactFileLines.begin(); 
2686          iter != ContactFileLines.end(); ++iter){
2687         
2688                 ExtraLineSeek = TRUE;
2690                 iterbool = ContactFileProcessed.find(iter->first);
2691                 
2692                 ContactLine = iter->second;
2693                 
2694                 // Ignore certain variables as they are not needed.
2695                 
2696                 if (ContactLine == wxT("BEGIN:VCARD") || 
2697                 ContactLine == wxT("END:VCARD") || 
2698                 ContactLine.Mid(0, 8) == wxT("VERSION:") || 
2699                 ContactLine.Mid(0, 7) == wxT("PRODID:") || 
2700                 ContactLine.Mid(0, 5) == wxT("X-AIM") || 
2701                 ContactLine.Mid(0, 5) == wxT("X-MSN") || 
2702                 ContactLine.Mid(0, 5) == wxT("X-ICQ") || 
2703                 ContactLine.Mid(0, 10) == wxT("X-GADUGADU") || 
2704                 ContactLine.Mid(0, 7) == wxT("X-YAHOO") || 
2705                 ContactLine.Mid(0, 7) == wxT("X-SKYPE") || 
2706                 ContactLine.Mid(0, 8) == wxT("X-JABBER") ||
2707                 ContactLine.Mid(0, 4) == wxT("REV:")){
2708                         
2709                         iterbool->second = TRUE;
2710                         continue;
2711                         
2712                 }
2713                 
2714                 if (iterbool->second == TRUE){
2715                         
2716                         continue;
2717                         
2718                 }
2719                 
2720                 if (ContactLine.Mid(0, 1) == wxT(" ") || ContactLine.Mid(0, 1) == wxT("\t")){
2721                 
2722                         continue;
2723                 
2724                 }
2725         
2726                 if (ContactLine.Mid(0, 4) == wxT("item")){
2727                 
2728                         // Line is a itemn... so ignore.
2729                 
2730                         continue;
2731                 
2732                 }
2733                 
2734                 std::map<int,wxString>::iterator itersub = iter;
2736                 while (ExtraLineSeek == TRUE){
2737                 
2738                         // Check if there is extra data on the next line 
2739                         // (indicated by space or tab at the start) and add data.
2741                         if (itersub == ContactFileLines.end()){
2742                                 ExtraLineSeekSub;
2743                                 continue;
2744                         }
2745                         else {
2746                                 itersub++;
2748                         }
2750                         iterboolsub = ContactFileProcessedWorking.find(itersub->first);
2752                         if (iterboolsub == ContactFileProcessedWorking.end()){
2753                         
2754                                 break;
2755                         
2756                         }
2757                         
2758                         if (iterboolsub->second == TRUE){
2759                         
2760                                 continue;
2761                         
2762                         }
2763                         
2764                         if (itersub == ContactFileLines.end()){
2765                         
2766                                 break;
2767                         
2768                         }                       
2769                 
2770                         wxSPropertyNextLine = itersub->second;
2771                 
2772                         if (wxSPropertyNextLine.Mid(0, 1) == wxT(" ") || wxSPropertyNextLine.Mid(0, 1) == wxT("\t")){
2773                 
2774                                 wxSPropertyNextLine.Remove(0, 1);
2775                                 //wxSPropertyNextLine.Trim(FALSE);
2776                                 //ContactLine.Trim();
2777                                 ContactLine.Append(wxSPropertyNextLine);
2778                                 iterboolsub->second = TRUE;
2779                 
2780                         } else {
2781                         
2782                                 ExtraLineSeek = FALSE;
2783                         
2784                         }
2785                 
2786                 }
2787                 
2788                 ContactLineLen = ContactLine.Len();
2789                 
2790                 for (int i = 0; i <= ContactLineLen; i++){
2791                 
2792                         if ((ContactLine.Mid(i, 1) == wxT(";") || ContactLine.Mid(i, 1) == wxT(":")) && PropertyFind == TRUE){
2793                         
2794                                 PropertyFind = FALSE;
2795                         
2796                         } else if (PropertyFind == TRUE){
2797                         
2798                                 wxSProperty.Append(ContactLine.Mid(i, 1));
2799                         
2800                         }               
2801                 
2802                         if (ContactLine.Mid(i, 1) == wxT("\"")){
2803                         
2804                                 if (QuoteMode == TRUE){
2805                                 
2806                                         QuoteMode = FALSE;
2807                                 
2808                                 } else {
2809                         
2810                                         QuoteMode = TRUE;
2811                                         
2812                                 }
2813                         
2814                         }
2815                         
2816                         if (ContactLine.Mid(i, 1) == wxT(":") && ContactLine.Mid((i - 1), 1) != wxT("\\") && QuoteMode == FALSE){
2817                         
2818                                 QuoteBreakPoint = i;
2819                                 break;
2820                         
2821                         }
2822                 
2823                 }
2825                 wxSPropertySeg1 = ContactLine.Mid(0, QuoteBreakPoint);
2826                 wxSPropertySeg2 = ContactLine.Mid((QuoteBreakPoint + 1));
2828                 wxStringTokenizer wxSPropertySegSplit(wxSPropertySeg1, wxT(";"));
2829                 wxSProperty = wxSPropertySegSplit.GetNextToken();
2831                 std::map<int,int> DataLineProcess;
2832                 std::map<int, bool>::iterator DLSLiter;
2833                 int DataLineSeek = 0;
2834                 
2835                 // Look for the X-VCARD4-(variablename) equivilant.
2836                 
2837                 wxSPropertyVCARD4 = wxT("X-VCARD4-") + wxSProperty;
2838                         
2839                 // Sort out remainder of the types.
2840                 
2841                 ConvertV4PropertyProc(&wxSProperty, &wxSPropertySeg1, &wxSPropertySeg2, 
2842                         &wxSPropertyValues, &wxSPropertyData, &wxSPropertyXVCard4Value, 
2843                         &wxSPropertyNameConv, &PropertyData, &PropertyLock, FALSE, &VCard3Value, &XVCard4Value);
2844                 
2845                 wxString FinalPropertyData;
2846         
2847                 FinalPropertyData.Append(wxSPropertyNameConv);
2848         
2849                 for (std::map<wxString, wxString>::iterator striter = PropertyData.begin(); 
2850                 striter != PropertyData.end(); ++striter){
2852                         FinalPropertyData.Append(wxT(";"));             
2853                         FinalPropertyData.Append(striter->first);
2854                         FinalPropertyData.Append(wxT("="));
2855                         FinalPropertyData.Append(striter->second);
2856                 
2857                 }
2858                 
2859                 wxString FinalPropValue;
2860                 
2861                 if (wxSPropertyXVCard4Value.IsEmpty()){
2862                 
2863                         FinalPropValue = wxSPropertyData;
2864                 
2865                 } else {
2866                 
2867                         if (wxSPropertyXVCard4Value != wxSPropertyData){
2868                 
2869                                 FinalPropValue = wxSPropertyXVCard4Value;
2870                         
2871                         }
2872                 
2873                 }
2874                 
2875                 vCardOut->AddRaw(FinalPropertyData, FinalPropValue);
2877                 wxSProperty.clear();
2878                 wxSPropertySub.Clear();
2879                 wxSPropertySeg1.Clear();
2880                 wxSPropertySeg2.Clear();
2881                 wxSPropertyValues.Clear();
2882                 wxSPropertyData.Clear();
2883                 wxSPropertyXVCard4Value.Clear();
2884                 wxSPropertyNameConv.Clear();
2885                 //FinalPropertyData.clear();
2886                 //FinalPropValue.clear();
2887                 PropertyData.clear();
2888                 PropertyLock.clear();
2889                 ContactLine.clear();
2890                 XVCard4Value = FALSE;
2891                 VCard3Value = FALSE;
2892         
2893         }
2894         
2895         int FNCount = 0;
2896         int NameCount = 0;
2897         int NicknameCount = 0;
2898         int ADRCount = 0;
2899         int EmailCount = 0;
2900         int IMPPCount = 0;
2901         int TelCount = 0;
2902         int LangCount = 0;
2903         int TZCount = 0;
2904         int GeoCount = 0;
2905         int URLCount = 0;
2906         int RelatedCount = 0;
2907         int TitleCount = 0;
2908         int RoleCount = 0;
2909         int OrgCount = 0;
2910         int NoteCount = 0;
2911         int CategoryCount = 0;
2912         int PhotoCount = 0;
2913         int LogoCount = 0;
2914         int SoundCount = 0;
2915         int CalAdrCount = 0;
2916         int CalReqAdrCount = 0;
2917         int FreeBusyCount = 0;
2918         int KeyCount = 0;
2919         int VendorCount = 0;
2920         int XTokenCount = 0;
2921         int ItemSeek = 1;
2922         int MaxItemNumber = 0;
2923         int ItemOrdered = 0;
2924         int ItemUnordered = 0;
2925         int ItemNumber = 0;
2926         int ItemStringSeekLen = 0;
2927         int ItemSeekSub = 0;
2928         int ItemSeekSecSub = 0;
2929         //int intValueSeek = 1;
2930         
2931         std::map<int, wxString> NumberedName;
2932         std::map<int, wxString> NumberedData;
2933         std::map<int, wxString> NumberedPropValues;
2934         std::map<int, wxString> NumberedPropOldValue;
2935         
2936         std::map<int, wxString> UnNumberedName;
2937         std::map<int, wxString> UnNumberedData;
2938         std::map<int, wxString> UnNumberedPropValues;
2939         std::map<int, wxString> UnNumberedPropOldValue;
2941         // Part 1: Get the itemn number.
2942         
2943         std::map<int,bool>::iterator iterboolsecsub;
2944         std::map<int,wxString>::iterator itersub;
2945         std::map<int, wxString> TempData;
2946         PropertyData.clear();
2947         PropertyLock.clear();
2948         wxString ItemString;
2949         wxString ItemStringSeek;
2950         wxString ItemPropName;
2951         ContactLineSeek = 0;
2952         
2953         ContactLineSub.clear();
2954         ExtraLineSeekSub = 0;
2955         wxString wxSPropertyNextLineSub;
2956         ContactLineSubLen = 0;
2957         int ContactLineSeekSub = 0;
2958         int ItemIndex = 0;
2959         PropertFindSub.clear();
2960         wxSPropertySub.clear();
2961         wxSPropertySeg1Sub.clear();
2962         wxSPropertySeg2Sub.clear();
2963         wxSPropertyValues.clear();
2964         wxSPropertyData.clear();
2965         wxSPropertyNameConv.clear();
2966         wxSPropertyXVCard4Value.clear();
2967         ItemProcString.clear();
2968         
2969         XVCard4Value = FALSE;
2970         VCard3Value = FALSE;
2971         SeekItemData = FALSE;
2972         
2973         std::map<wxString, void*> ItemMapIndex;
2974         //std::map<wxString, wxString> ItemNameIndex;
2975         
2976         // Look for item in the initial line, process into a proper line then
2977         // look for other lines with the same item association.
2978         
2979         for (std::map<int,wxString>::iterator iter = ContactFileLines.begin();
2980                 iter != ContactFileLines.end(); ++iter){
2981         
2982                 ExtraLineSeek = TRUE;
2983                 
2984                 iterbool = ContactFileProcessed.find(iter->first);
2985                 
2986                 if (iterbool->second == TRUE){
2987                 
2988                         continue;
2989                 
2990                 }
2991                 
2992                 ContactLine = iter->second;
2993                 
2994                 if (ContactLine.Mid(0, 1) == wxT(" ") || ContactLine.Mid(0, 1) == wxT("\t")){
2995                 
2996                         continue;
2997                 
2998                 }
2999                 
3000                 if (ContactLine.Mid(0, 4) != wxT("item")){
3001                 
3002                         continue;
3003                 
3004                 }
3005                 
3006                 // Get Item data.
3008                 //ContactLineSeekSub = ContactLineSeek;
3009                 std::map<int,wxString>::iterator itersub = iter;
3011                 while (ExtraLineSeek == TRUE){
3012                 
3013                         // Check if there is extra data on the next line 
3014                         // (indicated by space or tab at the start) and add data.
3015                 
3016                         itersub++;
3017                         iterboolsub = ContactFileProcessed.find(itersub->first);
3019                         if (iterboolsub == ContactFileProcessed.end()){
3020                         
3021                                 break;
3022                         
3023                         }
3024                         
3025                         if (iterboolsub->second == TRUE){
3026                         
3027                                 continue;
3028                         
3029                         }
3030                         
3031                         if (itersub == ContactFileLines.end()){
3032                         
3033                                 break;
3034                         
3035                         }                       
3036                 
3037                         wxSPropertyNextLine = itersub->second;
3038                 
3039                         if (wxSPropertyNextLine.Mid(0, 1) == wxT(" ") || wxSPropertyNextLine.Mid(0, 1) == wxT("\t")){
3040                 
3041                                 wxSPropertyNextLine.Remove(0, 1);
3042                                 //wxSPropertyNextLine.Trim(FALSE);
3043                                 //ContactLine.Trim();
3044                                 ContactLine.Append(wxSPropertyNextLine);
3045                                 iterboolsub->second = TRUE;
3046                 
3047                         } else {
3048                         
3049                                 ExtraLineSeek = FALSE;
3050                         
3051                         }
3052                 
3053                 }
3054                 
3055                 ContactLineLen = ContactLine.Len();
3056                 
3057                 for (int i = 0; i <= ContactLineLen; i++){
3058                 
3059                         if ((ContactLine.Mid(i, 1) == wxT(";") || ContactLine.Mid(i, 1) == wxT(":")) && PropertyFind == TRUE){
3060                         
3061                                 PropertyFind = FALSE;
3062                         
3063                         } else if (PropertyFind == TRUE){
3064                         
3065                                 wxSProperty.Append(ContactLine.Mid(i, 1));
3066                         
3067                         }               
3068                 
3069                         if (ContactLine.Mid(i, 1) == wxT("\"")){
3070                         
3071                                 if (QuoteMode == TRUE){
3072                                 
3073                                         QuoteMode = FALSE;
3074                                 
3075                                 } else {
3076                         
3077                                         QuoteMode = TRUE;
3078                                         
3079                                 }
3080                         
3081                         }
3082                         
3083                         if (ContactLine.Mid(i, 1) == wxT(":") && ContactLine.Mid((i - 1), 1) != wxT("\\") && QuoteMode == FALSE){
3084                         
3085                                 QuoteBreakPoint = i;
3086                                 break;
3087                         
3088                         }
3089                 
3090                 }
3092                 wxSPropertySeg1 = ContactLine.Mid(0, QuoteBreakPoint);
3093                 wxSPropertySeg2 = ContactLine.Mid((QuoteBreakPoint + 1));
3094                 
3095                 // Go through the lines and collect the lines like itemn.
3096                 
3097                 std::map<int,wxString> *ItemListData;
3098                 ItemListData = new std::map<int,wxString>;
3099                 
3100                 wxStringTokenizer ItemData(wxSPropertySeg1, wxT("."));
3101                 
3102                 ItemString = ItemData.GetNextToken();
3103                 ItemStringSeek = wxT("item") + ItemString.Mid(4);
3104                 
3105                 wxStringTokenizer ItemPropSplit(ItemData.GetNextToken(), wxT(";"));
3106                 
3107                 ItemPropName = ItemPropSplit.GetNextToken();
3108                 
3109                 ItemStringSeekLen = ItemStringSeek.Len();
3110                 
3111                 ItemIndex = 0;
3112                 
3113                 for (std::map<int,wxString>::iterator itersec = ContactFileLines.begin();
3114                 itersec != ContactFileLines.end(); ++itersec){
3115                 
3116                         ExtraLineSeek = TRUE;
3117                 
3118                         iterboolsub = ContactFileProcessed.find(itersec->first);
3119                 
3120                         if (iterboolsub->second == TRUE){
3121                         
3122                                 continue;
3123                         
3124                         }
3125                 
3126                         ContactLineSub = itersec->second;
3127                         
3128                         wxStringTokenizer ItemProcData(ContactLineSub, wxT("."));
3129                         ItemProcString = ItemData.GetNextToken();
3130                         
3131                         if (ItemStringSeek != ContactLineSub.Mid(0, ItemStringSeekLen)){
3132                         
3133                                 continue;
3134                         
3135                         }
3136                         
3137                         ItemIndex++;
3138                         
3139                         ItemListData->insert(std::make_pair(ItemIndex, ContactLineSub));
3140                         
3141                         iterboolsub->second = TRUE;
3142                 
3143                 }
3144                 
3145                 //ItemNameIndex.insert(std::make_pair(ItemStringSeek, ItemPropName));
3146                 ItemListData->insert(std::make_pair(ItemIndex, ContactLineSub));
3147                 ItemMapIndex.insert(std::make_pair(ItemStringSeek, ItemListData));
3148                 
3149         }
3150         
3151         // Process each itemn set.
3152         
3153         for (std::map<wxString, void*>::iterator iter = ItemMapIndex.begin();
3154                 iter != ItemMapIndex.end(); ++iter){
3155                         
3156                 std::map<int, wxString> *ItemDataPtr;
3158                 ItemDataPtr = (std::map<int,wxString>*)iter->second;
3159                 
3160                 for (std::map<int,wxString>::iterator itersub = ItemDataPtr->begin();
3161                         itersub != ItemDataPtr->end(); ++itersub){
3162                         
3163                         ContactLine = itersub->second;
3164                         
3165                         ContactLineLen = ContactLine.Len();
3166                 
3167                         for (int i = 0; i <= ContactLineLen; i++){
3168                 
3169                                 if ((ContactLine.Mid(i, 1) == wxT(";") || ContactLine.Mid(i, 1) == wxT(":")) && PropertyFind == TRUE){
3170                         
3171                                         PropertyFind = FALSE;
3172                         
3173                                 } else if (PropertyFind == TRUE){
3174                         
3175                                         wxSProperty.Append(ContactLine.Mid(i, 1));
3176                         
3177                                 }               
3178                 
3179                                 if (ContactLine.Mid(i, 1) == wxT("\"")){
3180                         
3181                                         if (QuoteMode == TRUE){
3182                                 
3183                                                 QuoteMode = FALSE;
3184                                 
3185                                         } else {
3186                         
3187                                                 QuoteMode = TRUE;
3188                                         
3189                                         }
3190                         
3191                                 }
3192                         
3193                                 if (ContactLine.Mid(i, 1) == wxT(":") && ContactLine.Mid((i - 1), 1) != wxT("\\") && QuoteMode == FALSE){
3194                         
3195                                         QuoteBreakPoint = i;
3196                                         break;
3197                         
3198                                 }
3199                 
3200                         }
3201                         
3202                         wxSPropertySeg1Sub = ContactLine.Mid(0, QuoteBreakPoint);
3203                         wxSPropertySeg2Sub = ContactLine.Mid((QuoteBreakPoint + 1));
3204                         
3205                         wxStringTokenizer wxSPropertySegSplit(wxSPropertySeg1Sub, wxT(";"));
3206                         wxSProperty = wxSPropertySegSplit.GetNextToken();
3207                         
3208                         // Sort out remainder of the types.
3209                         
3210                         // Skip certain X-* IM variables as they are processed via
3211                         // IMPP.
3212                         
3213                         if (wxSProperty == wxT("X-AIM") || wxSProperty == wxT("X-MSN") || 
3214                         wxSProperty == wxT("X-ICQ") || wxSProperty == wxT("X-GADUGADU") || 
3215                         wxSProperty == wxT("X-YAHOO") || wxSProperty == wxT("X-SKYPE") || 
3216                         wxSProperty == wxT("X-JABBER")){
3217                 
3218                                 wxSProperty.clear();
3219                                 wxSPropertySub.Clear();
3220                                 wxSPropertySeg1.Clear();
3221                                 wxSPropertySeg2.Clear();
3222                                 wxSPropertyValues.Clear();
3223                                 wxSPropertyData.Clear();
3224                                 wxSPropertyXVCard4Value.Clear();
3225                                 wxSPropertyNameConv.Clear();
3226                                 //FinalPropertyData.clear();
3227                                 //FinalPropValue.clear();
3228                                 PropertyData.clear();
3229                                 PropertyLock.clear();
3230                                 ContactLine.clear();
3231                                 XVCard4Value = FALSE;
3232                                 VCard3Value = FALSE;
3233                                 continue;
3234                 
3235                         }
3236                         
3237                         ConvertV4PropertyProc(&wxSProperty, &wxSPropertySeg1Sub, &wxSPropertySeg2Sub, 
3238                         &wxSPropertyValues, &wxSPropertyData, &wxSPropertyXVCard4Value, 
3239                         &wxSPropertyNameConv, &PropertyData, &PropertyLock, TRUE, &VCard3Value, &XVCard4Value);
3240                         
3241                 }
3242                 
3243                 if (wxSPropertyNameConv.IsEmpty()){
3244                 
3245                         wxSProperty.clear();
3246                         wxSPropertySub.Clear();
3247                         wxSPropertySeg1.Clear();
3248                         wxSPropertySeg2.Clear();
3249                         wxSPropertyValues.Clear();
3250                         wxSPropertyData.Clear();
3251                         wxSPropertyXVCard4Value.Clear();
3252                         wxSPropertyNameConv.Clear();
3253                         //FinalPropertyData.clear();
3254                         //FinalPropValue.clear();
3255                         PropertyData.clear();
3256                         PropertyLock.clear();
3257                         ContactLine.clear();
3258                         XVCard4Value = FALSE;
3259                         VCard3Value = FALSE;
3260                         continue;
3261                 
3262                 }
3263                 
3264                 wxString FinalPropertyData;
3265         
3266                 FinalPropertyData.Append(wxSPropertyNameConv);
3267         
3268                 for (std::map<wxString, wxString>::iterator striter = PropertyData.begin(); 
3269                 striter != PropertyData.end(); ++striter){
3271                         FinalPropertyData.Append(wxT(";"));             
3272                         FinalPropertyData.Append(striter->first);
3273                         FinalPropertyData.Append(wxT("="));
3274                         FinalPropertyData.Append(striter->second);
3275                 
3276                 }
3277                 
3278                 wxString FinalPropValue;
3279                 
3280                 if (wxSPropertyXVCard4Value.IsEmpty()){
3281                 
3282                         FinalPropValue = wxSPropertyData;
3283                 
3284                 } else {
3285                 
3286                         if (wxSPropertyXVCard4Value != wxSPropertyData){
3287                         
3288                                 FinalPropValue = wxSPropertyData;
3289                                 
3290                         } else {
3291                 
3292                                 FinalPropValue = wxSPropertyXVCard4Value;
3293                 
3294                         }
3295                 
3296                 }
3297                 
3298                 vCardOut->AddRaw(FinalPropertyData, FinalPropValue);
3299                 
3300                 wxSProperty.clear();
3301                 wxSPropertySub.Clear();
3302                 wxSPropertySeg1Sub.Clear();
3303                 wxSPropertySeg2Sub.Clear();
3304                 wxSPropertyValues.Clear();
3305                 wxSPropertyData.Clear();
3306                 wxSPropertyXVCard4Value.Clear();
3307                 wxSPropertyNameConv.Clear();
3308                 FinalPropertyData.clear();
3309                 FinalPropValue.clear();
3310                 PropertyData.clear();
3311                 PropertyLock.clear();
3312                 ContactLine.clear();
3313                 XVCard4Value = FALSE;
3314                 VCard3Value = FALSE;
3315         
3316                 TempData.clear();
3317                 //PropertyData.clear();
3318                 //PropertyLock.clear();
3319                 
3320         }
3321         
3322         // Delete data.
3323         
3324         std::map<int, wxString> *ItemEraseData;
3325         
3326         for (std::map<wxString, void*>::iterator iter = ItemMapIndex.begin();
3327                 iter != ItemMapIndex.end(); ++iter){
3328                 
3329                 ItemEraseData = (std::map<int,wxString>*)iter->second;
3331                 delete ItemEraseData;
3332                 ItemEraseData = NULL;
3333                 
3334         }
3336         ItemMapIndex.clear();
3337         
3338         vCardOut->AddRaw(wxT("END"), wxT("VCARD"));
3340         return TRUE;
3344 void vCard34Conv::ConvertV4PropertyProc(wxString *wxSPropertyName, 
3345         wxString *wxSPropertySeg1Ptr, wxString *wxSPropertySeg2Ptr, 
3346         wxString *wxSPropertyPropValuesOut, wxString *wxSPropertyDataOut, 
3347         wxString *wxSPropertyXVCard4Value, wxString *wxSPropertyDataNameOut,
3348         std::map<wxString,wxString> *PropertyDataMap, 
3349         std::map<wxString,bool> *PropertyLockMap,
3350         bool ProcessItemData, bool *VCardV3Value, bool *XVCardV4Value){
3352         wxString wxSProperty;
3353         wxString wxSPropertySeg1Chopped;
3354         
3355         if (ProcessItemData == TRUE){
3356                 
3357                 wxStringTokenizer wxSPropertySplit(*wxSPropertyName, wxT("."));
3358         
3359                 wxSPropertySplit.GetNextToken();
3360                 wxSProperty = wxSPropertySplit.GetNextToken();
3361         
3362                 // Look for . in wxSPropertySeg1Ptr and remove all data before
3363                 // the .
3364         
3365                 int ItemSeek = wxSPropertySeg1Ptr->Find(wxT("."));
3366                 wxSPropertySeg1Chopped = wxSPropertySeg1Ptr->Mid((ItemSeek + 1));
3367                 
3368         
3369         } else {
3370         
3371                 wxSProperty = *wxSPropertyName;
3372         
3373         }
3375         
3376         // Go through each of the vCard 3.0 properties.
3377         
3378         // EMAIL
3379         
3380         if (wxSProperty == wxT("EMAIL")){
3381         
3382                 int intPropertyLen;
3383                 
3384                 if (ProcessItemData == TRUE){
3385         
3386                         intPropertyLen = wxSPropertySeg1Chopped.Len();          
3387                 
3388                 } else {
3389                 
3390                         intPropertyLen = wxSPropertySeg1Ptr->Len();
3391                 
3392                 }
3393                 
3394                 std::map<int, int> SplitPoints;
3395                 std::map<int, int> SplitLength;
3396                 std::map<int, int>::iterator SLiter;                    
3397                 wxString PropertyData;
3398                 wxString PropertyName;
3399                 wxString PropertyValue;
3400                 wxString PropertyTokens;
3401                 bool AfterFirstToken = FALSE;
3402                 bool FirstToken = TRUE;         
3403                 int intSplitsFound = 0;
3404                 int intSplitSize = 0;
3405                 int intPrevValue = 7;
3406                 int intPref = 0;                        
3407                 int intType = 0;
3408                 int intSplitSeek = 0;
3410                 
3411                 wxSPropertyDataOut->Append(*wxSPropertySeg2Ptr);
3412                 *wxSPropertyDataNameOut = wxT("EMAIL");
3413                 *VCardV3Value = TRUE;
3414                 
3415                 if (ProcessItemData == TRUE){
3416                 
3417                         SplitValues(&wxSPropertySeg1Chopped, &SplitPoints, &SplitLength, intPrevValue);
3418                         
3419                 } else {
3420                         
3421                         SplitValues(wxSPropertySeg1Ptr, &SplitPoints, &SplitLength, intPrevValue);
3422                         
3423                 }
3424                 
3425                 for (std::map<int, int>::iterator intiter = SplitPoints.begin(); 
3426                 intiter != SplitPoints.end(); ++intiter){
3427                 
3428                         SLiter = SplitLength.find(intiter->first);
3429                 
3430                         if (ProcessItemData == TRUE){
3431                 
3432                                 if (FirstToken == TRUE){
3433                         
3434                                         PropertyData = wxSPropertySeg1Chopped.Mid((intPrevValue - 1), (SLiter->second));
3435                                         FirstToken = FALSE;
3436                         
3437                                 } else {
3438                                 
3439                                         PropertyData = wxSPropertySeg1Chopped.Mid((intPrevValue), (SLiter->second));
3440                                 
3441                                 }
3442                         
3443                         } else {                        
3444                                 
3445                                 if (FirstToken == TRUE){
3446                         
3447                                         PropertyData = wxSPropertySeg1Ptr->Mid((intPrevValue - 1), (SLiter->second));
3448                                         FirstToken = FALSE;
3449                         
3450                                 } else {
3451                                 
3452                                         PropertyData = wxSPropertySeg1Ptr->Mid((intPrevValue), (SLiter->second));
3453                                 
3454                                 }
3455                         
3456                         }
3457                         
3458                         wxStringTokenizer PropertyElement (PropertyData, wxT("="));
3459                         PropertyName = PropertyElement.GetNextToken();                          
3460                         PropertyValue = PropertyElement.GetNextToken();
3461                         
3462                         //ProcessCaptureStrings(&PropertyValue);
3463                         
3464                         intPrevValue = intiter->second;
3465                         
3466                         if (PropertyName == wxT("type") && PropertyValue == wxT("INTERNET")){
3467                                 continue;
3468                         }
3469                                 
3470                         if (PropertyName == wxT("type") && PropertyValue == wxT("pref")){
3471                                 
3472                                 if (ProcessItemData == FALSE){
3473                                         PropertyName = wxT("PREF");
3474                                         PropertyValue = wxT("50");
3475                                 } else {
3476                                         continue;
3477                                 }
3478                                 
3479                         }
3480                         
3481                         if (PropertyName == wxT("type") && (PropertyValue == wxT("HOME") || PropertyValue == wxT("home"))){
3482                                 PropertyValue = wxT("home");
3483                         }
3484                         
3485                         if (PropertyName == wxT("type") && (PropertyValue == wxT("WORK") || PropertyValue == wxT("work"))){
3486                                 PropertyValue = wxT("work");
3487                         }
3489                         if (PropertyName == wxT("type") && (PropertyValue == wxT("OTHER") || PropertyValue == wxT("other"))){
3490                                 PropertyName = wxT("X-TYPE");
3491                                 PropertyValue = wxT("other");
3492                         }
3493                         
3494                         // Process properties.
3495                         
3496                         if (PropertyName.IsEmpty()){
3497                         
3498                                 continue;
3499                         
3500                         }
3501                         
3502                         if (PropertyDataMap->find(PropertyName) == PropertyDataMap->end()){
3504                                 PropertyDataMap->insert(std::make_pair(PropertyName, PropertyValue));
3505                                 PropertyLockMap->insert(std::make_pair(PropertyName, TRUE));
3506         
3507                         } else {
3508                         
3509                                 PropertyDataMap->erase(PropertyName);
3510                                 PropertyDataMap->insert(std::make_pair(PropertyName, PropertyValue));
3511                                 PropertyLockMap->erase(PropertyName);
3512                                 PropertyLockMap->insert(std::make_pair(PropertyName, TRUE));
3513                         
3514                         }
3515                 
3516                 }
3517         
3518         }
3519         
3520         // ADR
3521         
3522         if (wxSProperty == wxT("ADR")){
3523                 
3524                 int intPropertyLen;
3525                 
3526                 if (ProcessItemData == TRUE){
3527         
3528                         intPropertyLen = wxSPropertySeg1Chopped.Len();          
3529                 
3530                 } else {
3531                 
3532                         intPropertyLen = wxSPropertySeg1Ptr->Len();
3533                 
3534                 }
3535                 
3536                 std::map<int, int> SplitPoints;
3537                 std::map<int, int> SplitLength;
3538                 std::map<int, int>::iterator SLiter;                    
3539                 wxString PropertyData;
3540                 wxString PropertyName;
3541                 wxString PropertyValue;
3542                 wxString PropertyTokens;
3543                 bool AfterFirstToken = FALSE;
3544                 bool FirstToken = TRUE;         
3545                 int intSplitsFound = 0;
3546                 int intSplitSize = 0;
3547                 int intPrevValue = 5;
3548                 int intPref = 0;                        
3549                 int intType = 0;
3550                 int intSplitSeek = 0;
3552                 
3553                 wxSPropertyDataOut->Append(*wxSPropertySeg2Ptr);
3554                 *wxSPropertyDataNameOut = wxT("ADR");
3555                 *VCardV3Value = TRUE;
3556                 
3557                 if (ProcessItemData == TRUE){
3558                 
3559                         SplitValues(&wxSPropertySeg1Chopped, &SplitPoints, &SplitLength, intPrevValue);
3560                         
3561                 } else {
3562                         
3563                         SplitValues(wxSPropertySeg1Ptr, &SplitPoints, &SplitLength, intPrevValue);
3564                         
3565                 }
3566                 
3567                 for (std::map<int, int>::iterator intiter = SplitPoints.begin(); 
3568                 intiter != SplitPoints.end(); ++intiter){
3569                 
3570                         SLiter = SplitLength.find(intiter->first);
3571                 
3572                         if (ProcessItemData == TRUE){
3573                 
3574                                 if (FirstToken == TRUE){
3575                         
3576                                         PropertyData = wxSPropertySeg1Chopped.Mid((intPrevValue - 1), (SLiter->second));
3577                                         FirstToken = FALSE;
3578                         
3579                                 } else {
3580                                 
3581                                         PropertyData = wxSPropertySeg1Chopped.Mid((intPrevValue), (SLiter->second));
3582                                 
3583                                 }
3584                         
3585                         } else {                        
3586                                 
3587                                 if (FirstToken == TRUE){
3588                         
3589                                         PropertyData = wxSPropertySeg1Ptr->Mid((intPrevValue - 1), (SLiter->second));
3590                                         FirstToken = FALSE;
3591                         
3592                                 } else {
3593                                 
3594                                         PropertyData = wxSPropertySeg1Ptr->Mid((intPrevValue), (SLiter->second));
3595                                 
3596                                 }
3597                         
3598                         }
3599                         
3600                         wxStringTokenizer PropertyElement (PropertyData, wxT("="));
3601                         PropertyName = PropertyElement.GetNextToken();                          
3602                         PropertyValue = PropertyElement.GetNextToken();
3603                         
3604                         //ProcessCaptureStrings(&PropertyValue);
3605                         
3606                         intPrevValue = intiter->second;
3607                                 
3608                         if (PropertyName == wxT("type") && PropertyValue == wxT("pref")){
3609                                 
3610                                 if (ProcessItemData == FALSE){
3611                                         PropertyName = wxT("PREF");
3612                                         PropertyValue = wxT("50");
3613                                 } else {
3614                                         continue;
3615                                 }
3616                                 
3617                         }
3618                         
3619                         if (PropertyName == wxT("type") && (PropertyValue == wxT("HOME") || PropertyValue == wxT("home"))){
3620                                 PropertyValue = wxT("home");
3621                         }
3622                         
3623                         if (PropertyName == wxT("type") && (PropertyValue == wxT("WORK") || PropertyValue == wxT("work"))){
3624                                 PropertyValue = wxT("work");
3625                         }
3627                         if (PropertyName == wxT("type") && (PropertyValue == wxT("OTHER") || PropertyValue == wxT("other"))){
3628                                 PropertyName = wxT("X-TYPE");
3629                                 PropertyValue = wxT("other");
3630                         }
3631                         
3632                         // Process properties.
3633                         
3634                         if (PropertyName.IsEmpty()){
3635                         
3636                                 continue;
3637                         
3638                         }
3639                         
3640                         if (PropertyDataMap->find(PropertyName) == PropertyDataMap->end()){
3642                                 PropertyDataMap->insert(std::make_pair(PropertyName, PropertyValue));
3643                                 PropertyLockMap->insert(std::make_pair(PropertyName, TRUE));
3644         
3645                         } else {
3646                         
3647                                 PropertyDataMap->erase(PropertyName);
3648                                 PropertyDataMap->insert(std::make_pair(PropertyName, PropertyValue));
3649                                 PropertyLockMap->erase(PropertyName);
3650                                 PropertyLockMap->insert(std::make_pair(PropertyName, TRUE));
3651                         
3652                         }
3653                 
3654                 }
3655         
3656         }
3657         
3658         // LABEL
3659         
3660         if (wxSProperty == wxT("LABEL")){
3661                 
3662                 int intPropertyLen;
3663                 
3664                 if (ProcessItemData == TRUE){
3665         
3666                         intPropertyLen = wxSPropertySeg1Chopped.Len();          
3667                 
3668                 } else {
3669                 
3670                         intPropertyLen = wxSPropertySeg1Ptr->Len();
3671                 
3672                 }
3673                 
3674                 std::map<int, int> SplitPoints;
3675                 std::map<int, int> SplitLength;
3676                 std::map<int, int>::iterator SLiter;                    
3677                 wxString PropertyData;
3678                 wxString PropertyName;
3679                 wxString PropertyValue;
3680                 wxString PropertyTokens;
3681                 bool AfterFirstToken = FALSE;
3682                 bool FirstToken = TRUE;         
3683                 int intSplitsFound = 0;
3684                 int intSplitSize = 0;
3685                 int intPrevValue = 7;
3686                 int intPref = 0;                        
3687                 int intType = 0;
3688                 int intSplitSeek = 0;
3690                 
3691                 wxSPropertyDataOut->Append(*wxSPropertySeg2Ptr);
3692                 *wxSPropertyDataNameOut = wxT("ADR");
3693                 *VCardV3Value = TRUE;
3694                 
3695                 if (ProcessItemData == TRUE){
3696                 
3697                         SplitValues(&wxSPropertySeg1Chopped, &SplitPoints, &SplitLength, intPrevValue);
3698                         
3699                 } else {
3700                         
3701                         SplitValues(wxSPropertySeg1Ptr, &SplitPoints, &SplitLength, intPrevValue);
3702                         
3703                 }
3704                 
3705                 for (std::map<int, int>::iterator intiter = SplitPoints.begin(); 
3706                 intiter != SplitPoints.end(); ++intiter){
3707                 
3708                         SLiter = SplitLength.find(intiter->first);
3709                 
3710                         if (ProcessItemData == TRUE){
3711                 
3712                                 if (FirstToken == TRUE){
3713                         
3714                                         PropertyData = wxSPropertySeg1Chopped.Mid((intPrevValue - 1), (SLiter->second));
3715                                         FirstToken = FALSE;
3716                         
3717                                 } else {
3718                                 
3719                                         PropertyData = wxSPropertySeg1Chopped.Mid((intPrevValue), (SLiter->second));
3720                                 
3721                                 }
3722                         
3723                         } else {                        
3724                                 
3725                                 if (FirstToken == TRUE){
3726                         
3727                                         PropertyData = wxSPropertySeg1Ptr->Mid((intPrevValue - 1), (SLiter->second));
3728                                         FirstToken = FALSE;
3729                         
3730                                 } else {
3731                                 
3732                                         PropertyData = wxSPropertySeg1Ptr->Mid((intPrevValue), (SLiter->second));
3733                                 
3734                                 }
3735                         
3736                         }
3737                         
3738                         wxStringTokenizer PropertyElement (PropertyData, wxT("="));
3739                         PropertyName = PropertyElement.GetNextToken();                          
3740                         PropertyValue = PropertyElement.GetNextToken();
3741                         
3742                         //ProcessCaptureStrings(&PropertyValue);
3743                         
3744                         intPrevValue = intiter->second;
3745                                 
3746                         if (PropertyName == wxT("type") && PropertyValue == wxT("pref")){
3747                                 continue;
3748                         }
3749                         
3750                         if (PropertyName == wxT("type") && (PropertyValue == wxT("HOME") || PropertyValue == wxT("home"))){
3751                                 PropertyValue = wxT("home");
3752                         }
3753                         
3754                         if (PropertyName == wxT("type") && (PropertyValue == wxT("WORK") || PropertyValue == wxT("work"))){
3755                                 PropertyValue = wxT("work");
3756                         }
3758                         if (PropertyName == wxT("type") && (PropertyValue == wxT("OTHER") || PropertyValue == wxT("other"))){
3759                                 PropertyName = wxT("X-TYPE");
3760                                 PropertyValue = wxT("other");
3761                         }
3762                         
3763                         // Process properties.
3764                         
3765                         if (PropertyName.IsEmpty()){
3766                         
3767                                 continue;
3768                         
3769                         }
3770                         
3771                         if (PropertyDataMap->find(PropertyName) == PropertyDataMap->end()){
3773                                 PropertyDataMap->insert(std::make_pair(PropertyName, PropertyValue));
3774                                 PropertyLockMap->insert(std::make_pair(PropertyName, TRUE));
3775         
3776                         } else {
3777                         
3778                                 PropertyDataMap->erase(PropertyName);
3779                                 PropertyDataMap->insert(std::make_pair(PropertyName, PropertyValue));
3780                                 PropertyLockMap->erase(PropertyName);
3781                                 PropertyLockMap->insert(std::make_pair(PropertyName, TRUE));
3782                         
3783                         }
3784                 
3785                 }
3786                 
3787                 PropertyDataMap->insert(std::make_pair(wxT("X-LABEL"), wxT("TRUE")));
3788         
3789         }
3790         
3791         // IMPP
3792         
3793         if (wxSProperty == wxT("IMPP")){
3794                 
3795                 int intPropertyLen;
3796                 
3797                 if (ProcessItemData == TRUE){
3798         
3799                         intPropertyLen = wxSPropertySeg1Chopped.Len();          
3800                 
3801                 } else {
3802                 
3803                         intPropertyLen = wxSPropertySeg1Ptr->Len();
3804                 
3805                 }
3806                 
3807                 std::map<int, int> SplitPoints;
3808                 std::map<int, int> SplitLength;
3809                 std::map<int, int>::iterator SLiter;                    
3810                 wxString PropertyData;
3811                 wxString PropertyName;
3812                 wxString PropertyValue;
3813                 wxString PropertyTokens;
3814                 bool AfterFirstToken = FALSE;
3815                 bool FirstToken = TRUE;         
3816                 int intSplitsFound = 0;
3817                 int intSplitSize = 0;
3818                 int intPrevValue = 6;
3819                 int intPref = 0;                        
3820                 int intType = 0;
3821                 int intSplitSeek = 0;
3823                 
3824                 wxStringTokenizer IMPPSplit(*wxSPropertySeg2Ptr, wxT(":"));
3825                 wxString IMPPType;
3826                 wxString IMPPData;
3827                 
3828                 IMPPType = IMPPSplit.GetNextToken();
3829                 
3830                 if (IMPPSplit.HasMoreTokens()){
3831                 
3832                         IMPPData = IMPPSplit.GetNextToken();
3833                 
3834                         if (IMPPType == wxT("ymsgr")){
3835                         
3836                                 IMPPType = wxT("yahoo");
3837                         
3838                         }
3839                         
3840                         *wxSPropertySeg2Ptr = IMPPType + wxT(":") + IMPPData;
3841                 
3842                 }
3843                 
3844                 wxSPropertyDataOut->Append(*wxSPropertySeg2Ptr);
3845                 *wxSPropertyDataNameOut = wxT("IMPP");
3846                 *VCardV3Value = TRUE;
3847                 
3848                 if (ProcessItemData == TRUE){
3849                 
3850                         SplitValues(&wxSPropertySeg1Chopped, &SplitPoints, &SplitLength, intPrevValue);
3851                         
3852                 } else {
3853                         
3854                         SplitValues(wxSPropertySeg1Ptr, &SplitPoints, &SplitLength, intPrevValue);
3855                         
3856                 }
3857                 
3858                 for (std::map<int, int>::iterator intiter = SplitPoints.begin(); 
3859                 intiter != SplitPoints.end(); ++intiter){
3860                 
3861                         SLiter = SplitLength.find(intiter->first);
3862                 
3863                         if (ProcessItemData == TRUE){
3864                 
3865                                 if (FirstToken == TRUE){
3866                         
3867                                         PropertyData = wxSPropertySeg1Chopped.Mid((intPrevValue - 1), (SLiter->second));
3868                                         FirstToken = FALSE;
3869                         
3870                                 } else {
3871                                 
3872                                         PropertyData = wxSPropertySeg1Chopped.Mid((intPrevValue), (SLiter->second));
3873                                 
3874                                 }
3875                         
3876                         } else {                        
3877                                 
3878                                 if (FirstToken == TRUE){
3879                         
3880                                         PropertyData = wxSPropertySeg1Ptr->Mid((intPrevValue - 1), (SLiter->second));
3881                                         FirstToken = FALSE;
3882                         
3883                                 } else {
3884                                 
3885                                         PropertyData = wxSPropertySeg1Ptr->Mid((intPrevValue), (SLiter->second));
3886                                 
3887                                 }
3888                         
3889                         }
3890                         
3891                         wxStringTokenizer PropertyElement (PropertyData, wxT("="));
3892                         PropertyName = PropertyElement.GetNextToken();                          
3893                         PropertyValue = PropertyElement.GetNextToken();
3894                         
3895                         //ProcessCaptureStrings(&PropertyValue);
3896                         
3897                         intPrevValue = intiter->second;
3898                                 
3899                         if (PropertyName == wxT("type") && PropertyValue == wxT("pref")){
3900                                 continue;
3901                         }
3902                         
3903                         if (PropertyName == wxT("X-SERVICE-TYPE")){
3904                                 continue;
3905                         }
3906                         
3907                         if (PropertyName == wxT("type") && (PropertyValue == wxT("HOME") || PropertyValue == wxT("home"))){
3908                                 PropertyValue = wxT("home");
3909                         }
3910                         
3911                         if (PropertyName == wxT("type") && (PropertyValue == wxT("WORK") || PropertyValue == wxT("work"))){
3912                                 PropertyValue = wxT("work");
3913                         }
3915                         if (PropertyName == wxT("type") && (PropertyValue == wxT("OTHER") || PropertyValue == wxT("other"))){
3916                                 PropertyName = wxT("X-TYPE");
3917                                 PropertyValue = wxT("other");
3918                         }
3919                         
3920                         // Process properties.
3921                         
3922                         if (PropertyName.IsEmpty()){
3923                         
3924                                 continue;
3925                         
3926                         }
3927                         
3928                         if (PropertyDataMap->find(PropertyName) == PropertyDataMap->end()){
3930                                 PropertyDataMap->insert(std::make_pair(PropertyName, PropertyValue));
3931                                 PropertyLockMap->insert(std::make_pair(PropertyName, TRUE));
3932         
3933                         } else {
3934                         
3935                                 PropertyDataMap->erase(PropertyName);
3936                                 PropertyDataMap->insert(std::make_pair(PropertyName, PropertyValue));
3937                                 PropertyLockMap->erase(PropertyName);
3938                                 PropertyLockMap->insert(std::make_pair(PropertyName, TRUE));
3939                         
3940                         }
3941                 
3942                 }
3943         
3944         }
3945         
3946         // TEL
3947         
3948         if (wxSProperty == wxT("TEL")){
3949                 
3950                 int intPropertyLen;
3951                 
3952                 if (ProcessItemData == TRUE){
3953         
3954                         intPropertyLen = wxSPropertySeg1Chopped.Len();          
3955                 
3956                 } else {
3957                 
3958                         intPropertyLen = wxSPropertySeg1Ptr->Len();
3959                 
3960                 }
3961                 
3962                 std::map<int, int> SplitPoints;
3963                 std::map<int, int> SplitLength;
3964                 std::map<int, int>::iterator SLiter;
3965                 std::map<wxString, wxString> TelType;                   
3966                 wxString PropertyData;
3967                 wxString PropertyName;
3968                 wxString PropertyValue;
3969                 wxString PropertyTokens;
3970                 bool AfterFirstToken = FALSE;
3971                 bool FirstToken = TRUE;         
3972                 int intSplitsFound = 0;
3973                 int intSplitSize = 0;
3974                 int intPrevValue = 5;
3975                 int intPref = 0;                        
3976                 int intType = 0;
3977                 int intSplitSeek = 0;
3979                 
3980                 wxSPropertyDataOut->Append(wxT("tel:"));
3981                 wxSPropertyDataOut->Append(*wxSPropertySeg2Ptr);
3982                 *wxSPropertyDataNameOut = wxT("TEL");
3983                 *VCardV3Value = TRUE;
3984                 
3985                 if (ProcessItemData == TRUE){
3986                 
3987                         SplitValues(&wxSPropertySeg1Chopped, &SplitPoints, &SplitLength, intPrevValue);
3988                         
3989                 } else {
3990                         
3991                         SplitValues(wxSPropertySeg1Ptr, &SplitPoints, &SplitLength, intPrevValue);
3992                         
3993                 }
3994                 
3995                 for (std::map<int, int>::iterator intiter = SplitPoints.begin(); 
3996                 intiter != SplitPoints.end(); ++intiter){
3997                 
3998                         SLiter = SplitLength.find(intiter->first);
3999                 
4000                         if (ProcessItemData == TRUE){
4001                 
4002                                 if (FirstToken == TRUE){
4003                         
4004                                         PropertyData = wxSPropertySeg1Chopped.Mid((intPrevValue - 1), (SLiter->second));
4005                                         FirstToken = FALSE;
4006                         
4007                                 } else {
4008                                 
4009                                         PropertyData = wxSPropertySeg1Chopped.Mid((intPrevValue), (SLiter->second));
4010                                 
4011                                 }
4012                         
4013                         } else {                        
4014                                 
4015                                 if (FirstToken == TRUE){
4016                         
4017                                         PropertyData = wxSPropertySeg1Ptr->Mid((intPrevValue - 1), (SLiter->second));
4018                                         FirstToken = FALSE;
4019                         
4020                                 } else {
4021                                 
4022                                         PropertyData = wxSPropertySeg1Ptr->Mid((intPrevValue), (SLiter->second));
4023                                 
4024                                 }
4025                         
4026                         }
4027                         
4028                         wxStringTokenizer PropertyElement (PropertyData, wxT("="));
4029                         PropertyName = PropertyElement.GetNextToken();                          
4030                         PropertyValue = PropertyElement.GetNextToken();
4031                         
4032                         //ProcessCaptureStrings(&PropertyValue);
4033                         
4034                         intPrevValue = intiter->second;
4035                                 
4036                         if (PropertyName == wxT("type") && PropertyValue == wxT("pref")){
4037                                 continue;
4038                         }
4039                         
4040                         if (PropertyName == wxT("type") && (PropertyValue == wxT("HOME") || PropertyValue == wxT("home"))){
4041                                 TelType.insert(std::make_pair(wxT("home"), wxT("home")));
4042                                 continue;
4043                         }
4044                         
4045                         if (PropertyName == wxT("type") && (PropertyValue == wxT("WORK") || PropertyValue == wxT("work"))){
4046                                 TelType.insert(std::make_pair(wxT("work"), wxT("work")));
4047                                 continue;
4048                         }
4050                         if (PropertyName == wxT("type") && (PropertyValue == wxT("OTHER") || PropertyValue == wxT("other"))){
4051                                 PropertyName = wxT("X-TYPE");
4052                                 PropertyValue = wxT("other");
4053                         }
4054                         
4055                         // Process the telephone type options.
4056                         
4057                         // text
4058                         
4059                         if (PropertyName == wxT("type") && (PropertyValue == wxT("TEXT") || PropertyValue == wxT("text"))){
4060                                 TelType.insert(std::make_pair(wxT("text"), wxT("text")));
4061                                 continue;
4062                         }
4063                         
4064                         // voice
4065                         
4066                         if (PropertyName == wxT("type") && (PropertyValue == wxT("VOICE") || PropertyValue == wxT("voice"))){
4067                                 TelType.insert(std::make_pair(wxT("voice"), wxT("voice")));
4068                                 continue;
4069                         }
4070                         
4071                         // fax
4072                         
4073                         if (PropertyName == wxT("type") && (PropertyValue == wxT("FAX") || PropertyValue == wxT("fax"))){
4074                                 TelType.insert(std::make_pair(wxT("fax"), wxT("fax")));
4075                                 continue;
4076                         }
4077                         
4078                         // cell
4079                         
4080                         if (PropertyName == wxT("type") && (PropertyValue == wxT("CELL") || PropertyValue == wxT("cell"))){
4081                                 TelType.insert(std::make_pair(wxT("cell"), wxT("cell")));
4082                                 continue;
4083                         }
4084                         
4085                         // video
4086                         
4087                         if (PropertyName == wxT("type") && (PropertyValue == wxT("VIDEO") || PropertyValue == wxT("video"))){
4088                                 TelType.insert(std::make_pair(wxT("video"), wxT("video")));
4089                                 continue;
4090                         }
4091                         
4092                         // pager
4093                         
4094                         if (PropertyName == wxT("type") && (PropertyValue == wxT("PAGER") || PropertyValue == wxT("pager"))){
4095                                 TelType.insert(std::make_pair(wxT("pager"), wxT("pager")));
4096                                 continue;
4097                         }
4098                         
4099                         // textphone
4100                         
4101                         if (PropertyName == wxT("type") && (PropertyValue == wxT("TEXTPHONE") || PropertyValue == wxT("textphone"))){
4102                                 TelType.insert(std::make_pair(wxT("textphone"), wxT("textphone")));
4103                                 continue;
4104                         }
4105                         
4106                         if (PropertyName == wxT("type") && PropertyValue.Find(wxT(",")) != wxNOT_FOUND){
4107                                 wxStringTokenizer TypeSplit(PropertyValue, wxT(","));
4108                                 wxString TypeSplitData;
4109                                 while (TypeSplit.HasMoreTokens()){
4110                                 
4111                                         TypeSplitData = TypeSplit.GetNextToken();
4112                                         TelType.insert(std::make_pair(TypeSplitData, TypeSplitData));
4113                                         TypeSplitData.clear();
4114                                 
4115                                 }
4116                                 
4117                         }
4118                         
4119                         // Process properties.
4120                         
4121                         if (PropertyName.IsEmpty()){
4122                         
4123                                 continue;
4124                         
4125                         }
4126                         
4127                         if (PropertyDataMap->find(PropertyName) == PropertyDataMap->end()){
4129                                 PropertyDataMap->insert(std::make_pair(PropertyName, PropertyValue));
4130                                 PropertyLockMap->insert(std::make_pair(PropertyName, TRUE));
4131         
4132                         } else {
4133                         
4134                                 PropertyDataMap->erase(PropertyName);
4135                                 PropertyDataMap->insert(std::make_pair(PropertyName, PropertyValue));
4136                                 PropertyLockMap->erase(PropertyName);
4137                                 PropertyLockMap->insert(std::make_pair(PropertyName, TRUE));
4138                         
4139                         }
4140                 
4141                 }
4142                 
4143                 wxString TelFinalString;
4144                 bool TelFirstToken = TRUE;
4145                 
4146                 for (std::map<wxString, wxString>::iterator intiter = TelType.begin(); 
4147                 intiter != TelType.end(); ++intiter){
4148                 
4149                         // Process the type data into a single value. (e.g. TYPE="work,voice,cell").
4150                         
4151                         if (TelFirstToken == TRUE){
4152                         
4153                                 TelFinalString.Append(wxT("\""));
4154                                 TelFinalString.Append(intiter->first);
4155                                 TelFirstToken = FALSE;
4156                         
4157                         } else {
4158                         
4159                                 TelFinalString.Append(wxT(","));
4160                                 TelFinalString.Append(intiter->first);
4161                         
4162                         }
4163                 
4164                 }
4165                 
4166                 if (TelFirstToken == FALSE){
4167                 
4168                         TelFinalString.Append(wxT("\""));
4169                 
4170                 }
4171                 
4172                 if (!TelFinalString.IsEmpty()){
4173                 
4174                         if (PropertyDataMap->find(wxT("TYPE")) == PropertyDataMap->end()){
4176                                 PropertyDataMap->insert(std::make_pair(wxT("type"), TelFinalString));
4177                                 PropertyLockMap->insert(std::make_pair(wxT("type"), TRUE));
4178         
4179                         } else {
4180                         
4181                                 PropertyDataMap->erase(PropertyName);
4182                                 PropertyDataMap->insert(std::make_pair(wxT("type"), TelFinalString));
4183                                 PropertyLockMap->erase(PropertyName);
4184                                 PropertyLockMap->insert(std::make_pair(wxT("type"), TRUE));
4185                         
4186                         }
4187                 
4188                 }
4189         
4190         }
4191         
4192         // RELATED
4193         
4194         if (wxSProperty == wxT("X-ABRELATEDNAMES")){
4195         
4196                 int intPropertyLen;
4197                 
4198                 if (ProcessItemData == TRUE){
4199         
4200                         intPropertyLen = wxSPropertySeg1Chopped.Len();          
4201                 
4202                 } else {
4203                 
4204                         intPropertyLen = wxSPropertySeg1Ptr->Len();
4205                 
4206                 }
4207                 
4208                 std::map<int, int> SplitPoints;
4209                 std::map<int, int> SplitLength;
4210                 std::map<int, int>::iterator SLiter;                    
4211                 wxString PropertyData;
4212                 wxString PropertyName;
4213                 wxString PropertyValue;
4214                 wxString PropertyTokens;
4215                 bool AfterFirstToken = FALSE;
4216                 bool FirstToken = TRUE;         
4217                 int intSplitsFound = 0;
4218                 int intSplitSize = 0;
4219                 int intPrevValue = 18;
4220                 int intPref = 0;                        
4221                 int intType = 0;
4222                 int intSplitSeek = 0;
4224                 
4225                 wxSPropertyDataOut->Append(*wxSPropertySeg2Ptr);
4226                 *wxSPropertyDataNameOut = wxT("RELATED");
4227                 *VCardV3Value = TRUE;
4228                 
4229                 if (ProcessItemData == TRUE){
4230                 
4231                         SplitValues(&wxSPropertySeg1Chopped, &SplitPoints, &SplitLength, intPrevValue);
4232                         
4233                 } else {
4234                         
4235                         SplitValues(wxSPropertySeg1Ptr, &SplitPoints, &SplitLength, intPrevValue);
4236                         
4237                 }
4238                 
4239                 for (std::map<int, int>::iterator intiter = SplitPoints.begin(); 
4240                 intiter != SplitPoints.end(); ++intiter){
4241                 
4242                         SLiter = SplitLength.find(intiter->first);
4243                 
4244                         if (ProcessItemData == TRUE){
4245                 
4246                                 if (FirstToken == TRUE){
4247                         
4248                                         PropertyData = wxSPropertySeg1Chopped.Mid((intPrevValue - 1), (SLiter->second));
4249                                         FirstToken = FALSE;
4250                         
4251                                 } else {
4252                                 
4253                                         PropertyData = wxSPropertySeg1Chopped.Mid((intPrevValue), (SLiter->second));
4254                                 
4255                                 }
4256                         
4257                         } else {                        
4258                                 
4259                                 if (FirstToken == TRUE){
4260                         
4261                                         PropertyData = wxSPropertySeg1Ptr->Mid((intPrevValue - 1), (SLiter->second));
4262                                         FirstToken = FALSE;
4263                         
4264                                 } else {
4265                                 
4266                                         PropertyData = wxSPropertySeg1Ptr->Mid((intPrevValue), (SLiter->second));
4267                                 
4268                                 }
4269                         
4270                         }
4271                         
4272                         wxStringTokenizer PropertyElement (PropertyData, wxT("="));
4273                         PropertyName = PropertyElement.GetNextToken();                          
4274                         PropertyValue = PropertyElement.GetNextToken();
4275                         
4276                         //ProcessCaptureStrings(&PropertyValue);
4277                         
4278                         intPrevValue = intiter->second;
4279                                 
4280                         if (PropertyName == wxT("type") && PropertyValue == wxT("pref")){
4281                                 continue;
4282                         }
4283                         
4284                         // Process properties.
4285                         
4286                         if (PropertyName.IsEmpty()){
4287                         
4288                                 continue;
4289                         
4290                         }
4291                         
4292                         if (PropertyDataMap->find(PropertyName) == PropertyDataMap->end()){
4294                                 PropertyDataMap->insert(std::make_pair(PropertyName, PropertyValue));
4295                                 PropertyLockMap->insert(std::make_pair(PropertyName, TRUE));
4296         
4297                         } else {
4298                         
4299                                 PropertyDataMap->erase(PropertyName);
4300                                 PropertyDataMap->insert(std::make_pair(PropertyName, PropertyValue));
4301                                 PropertyLockMap->erase(PropertyName);
4302                                 PropertyLockMap->insert(std::make_pair(PropertyName, TRUE));
4303                         
4304                         }
4305                 
4306                 }
4307         
4308         }
4309         
4310         // URL
4311         
4312         if (wxSProperty == wxT("URL")){
4313                 
4314                 int intPropertyLen;
4315                 
4316                 if (ProcessItemData == TRUE){
4317         
4318                         intPropertyLen = wxSPropertySeg1Chopped.Len();          
4319                 
4320                 } else {
4321                 
4322                         intPropertyLen = wxSPropertySeg1Ptr->Len();
4323                 
4324                 }
4325                 
4326                 std::map<int, int> SplitPoints;
4327                 std::map<int, int> SplitLength;
4328                 std::map<int, int>::iterator SLiter;                    
4329                 wxString PropertyData;
4330                 wxString PropertyName;
4331                 wxString PropertyValue;
4332                 wxString PropertyTokens;
4333                 bool AfterFirstToken = FALSE;
4334                 bool FirstToken = TRUE;         
4335                 int intSplitsFound = 0;
4336                 int intSplitSize = 0;
4337                 int intPrevValue = 5;
4338                 int intPref = 0;                        
4339                 int intType = 0;
4340                 int intSplitSeek = 0;
4342                 
4343                 wxSPropertyDataOut->Append(*wxSPropertySeg2Ptr);
4344                 *wxSPropertyDataNameOut = wxT("URL");
4345                 *VCardV3Value = TRUE;
4346                 
4347                 if (ProcessItemData == TRUE){
4348                 
4349                         SplitValues(&wxSPropertySeg1Chopped, &SplitPoints, &SplitLength, intPrevValue);
4350                         
4351                 } else {
4352                         
4353                         SplitValues(wxSPropertySeg1Ptr, &SplitPoints, &SplitLength, intPrevValue);
4354                         
4355                 }
4356                 
4357                 for (std::map<int, int>::iterator intiter = SplitPoints.begin(); 
4358                 intiter != SplitPoints.end(); ++intiter){
4359                 
4360                         SLiter = SplitLength.find(intiter->first);
4361                 
4362                         if (ProcessItemData == TRUE){
4363                 
4364                                 if (FirstToken == TRUE){
4365                         
4366                                         PropertyData = wxSPropertySeg1Chopped.Mid((intPrevValue - 1), (SLiter->second));
4367                                         FirstToken = FALSE;
4368                         
4369                                 } else {
4370                                 
4371                                         PropertyData = wxSPropertySeg1Chopped.Mid((intPrevValue), (SLiter->second));
4372                                 
4373                                 }
4374                         
4375                         } else {                        
4376                                 
4377                                 if (FirstToken == TRUE){
4378                         
4379                                         PropertyData = wxSPropertySeg1Ptr->Mid((intPrevValue - 1), (SLiter->second));
4380                                         FirstToken = FALSE;
4381                         
4382                                 } else {
4383                                 
4384                                         PropertyData = wxSPropertySeg1Ptr->Mid((intPrevValue), (SLiter->second));
4385                                 
4386                                 }
4387                         
4388                         }
4389                         
4390                         wxStringTokenizer PropertyElement (PropertyData, wxT("="));
4391                         PropertyName = PropertyElement.GetNextToken();                          
4392                         PropertyValue = PropertyElement.GetNextToken();
4393                         
4394                         //ProcessCaptureStrings(&PropertyValue);
4395                         
4396                         intPrevValue = intiter->second;
4397                                 
4398                         if (PropertyName == wxT("type") && PropertyValue == wxT("pref")){
4399                                 continue;
4400                         }
4401                         
4402                         if (PropertyName == wxT("type") && (PropertyValue == wxT("HOME") || PropertyValue == wxT("home"))){
4403                                 PropertyValue = wxT("home");
4404                         }
4405                         
4406                         if (PropertyName == wxT("type") && (PropertyValue == wxT("WORK") || PropertyValue == wxT("work"))){
4407                                 PropertyValue = wxT("work");
4408                         }
4410                         if (PropertyName == wxT("type") && (PropertyValue == wxT("OTHER") || PropertyValue == wxT("other"))){
4411                                 PropertyName = wxT("X-TYPE");
4412                                 PropertyValue = wxT("other");
4413                         }
4414                         
4415                         // Process properties.
4416                         
4417                         if (PropertyName.IsEmpty()){
4418                         
4419                                 continue;
4420                         
4421                         }
4422                         
4423                         if (PropertyDataMap->find(PropertyName) == PropertyDataMap->end()){
4425                                 PropertyDataMap->insert(std::make_pair(PropertyName, PropertyValue));
4426                                 PropertyLockMap->insert(std::make_pair(PropertyName, TRUE));
4427         
4428                         } else {
4429                         
4430                                 PropertyDataMap->erase(PropertyName);
4431                                 PropertyDataMap->insert(std::make_pair(PropertyName, PropertyValue));
4432                                 PropertyLockMap->erase(PropertyName);
4433                                 PropertyLockMap->insert(std::make_pair(PropertyName, TRUE));
4434                         
4435                         }
4436                 
4437                 }
4438         
4439         }
4440         
4441         // TITLE
4442         
4443         if (wxSProperty == wxT("TITLE")){
4444                 
4445                 int intPropertyLen;
4446                 
4447                 if (ProcessItemData == TRUE){
4448         
4449                         intPropertyLen = wxSPropertySeg1Chopped.Len();          
4450                 
4451                 } else {
4452                 
4453                         intPropertyLen = wxSPropertySeg1Ptr->Len();
4454                 
4455                 }
4456                 
4457                 std::map<int, int> SplitPoints;
4458                 std::map<int, int> SplitLength;
4459                 std::map<int, int>::iterator SLiter;                    
4460                 wxString PropertyData;
4461                 wxString PropertyName;
4462                 wxString PropertyValue;
4463                 wxString PropertyTokens;
4464                 bool AfterFirstToken = FALSE;
4465                 bool FirstToken = TRUE;         
4466                 int intSplitsFound = 0;
4467                 int intSplitSize = 0;
4468                 int intPrevValue = 7;
4469                 int intPref = 0;                        
4470                 int intType = 0;
4471                 int intSplitSeek = 0;
4473                 
4474                 wxSPropertyDataOut->Append(*wxSPropertySeg2Ptr);
4475                 *wxSPropertyDataNameOut = wxT("TITLE");
4476                 *VCardV3Value = TRUE;
4477                 
4478                 if (ProcessItemData == TRUE){
4479                 
4480                         SplitValues(&wxSPropertySeg1Chopped, &SplitPoints, &SplitLength, intPrevValue);
4481                         
4482                 } else {
4483                         
4484                         SplitValues(wxSPropertySeg1Ptr, &SplitPoints, &SplitLength, intPrevValue);
4485                         
4486                 }
4487                 
4488                 for (std::map<int, int>::iterator intiter = SplitPoints.begin(); 
4489                 intiter != SplitPoints.end(); ++intiter){
4490                 
4491                         SLiter = SplitLength.find(intiter->first);
4492                 
4493                         if (ProcessItemData == TRUE){
4494                 
4495                                 if (FirstToken == TRUE){
4496                         
4497                                         PropertyData = wxSPropertySeg1Chopped.Mid((intPrevValue - 1), (SLiter->second));
4498                                         FirstToken = FALSE;
4499                         
4500                                 } else {
4501                                 
4502                                         PropertyData = wxSPropertySeg1Chopped.Mid((intPrevValue), (SLiter->second));
4503                                 
4504                                 }
4505                         
4506                         } else {                        
4507                                 
4508                                 if (FirstToken == TRUE){
4509                         
4510                                         PropertyData = wxSPropertySeg1Ptr->Mid((intPrevValue - 1), (SLiter->second));
4511                                         FirstToken = FALSE;
4512                         
4513                                 } else {
4514                                 
4515                                         PropertyData = wxSPropertySeg1Ptr->Mid((intPrevValue), (SLiter->second));
4516                                 
4517                                 }
4518                         
4519                         }
4520                         
4521                         wxStringTokenizer PropertyElement (PropertyData, wxT("="));
4522                         PropertyName = PropertyElement.GetNextToken();                          
4523                         PropertyValue = PropertyElement.GetNextToken();
4524                         
4525                         //ProcessCaptureStrings(&PropertyValue);
4526                         
4527                         intPrevValue = intiter->second;
4528                         
4529                         // Process properties.
4530                         
4531                         if (PropertyName.IsEmpty()){
4532                         
4533                                 continue;
4534                         
4535                         }
4536                         
4537                         if (PropertyDataMap->find(PropertyName) == PropertyDataMap->end()){
4539                                 PropertyDataMap->insert(std::make_pair(PropertyName, PropertyValue));
4540                                 PropertyLockMap->insert(std::make_pair(PropertyName, TRUE));
4541         
4542                         } else {
4543                         
4544                                 PropertyDataMap->erase(PropertyName);
4545                                 PropertyDataMap->insert(std::make_pair(PropertyName, PropertyValue));
4546                                 PropertyLockMap->erase(PropertyName);
4547                                 PropertyLockMap->insert(std::make_pair(PropertyName, TRUE));
4548                         
4549                         }
4550                 
4551                 }
4552         
4553         }
4554         
4555         // FN
4556         
4557         if (wxSProperty == wxT("FN")){
4558                 
4559                 int intPropertyLen;
4560                 
4561                 if (ProcessItemData == TRUE){
4562         
4563                         intPropertyLen = wxSPropertySeg1Chopped.Len();          
4564                 
4565                 } else {
4566                 
4567                         intPropertyLen = wxSPropertySeg1Ptr->Len();
4568                 
4569                 }
4570                 
4571                 std::map<int, int> SplitPoints;
4572                 std::map<int, int> SplitLength;
4573                 std::map<int, int>::iterator SLiter;                    
4574                 wxString PropertyData;
4575                 wxString PropertyName;
4576                 wxString PropertyValue;
4577                 wxString PropertyTokens;
4578                 bool AfterFirstToken = FALSE;
4579                 bool FirstToken = TRUE;         
4580                 int intSplitsFound = 0;
4581                 int intSplitSize = 0;
4582                 int intPrevValue = 4;
4583                 int intPref = 0;                        
4584                 int intType = 0;
4585                 int intSplitSeek = 0;
4587                 
4588                 wxSPropertyDataOut->Append(*wxSPropertySeg2Ptr);
4589                 *wxSPropertyDataNameOut = wxT("FN");
4590                 *VCardV3Value = TRUE;
4591                 
4592                 if (ProcessItemData == TRUE){
4593                 
4594                         SplitValues(&wxSPropertySeg1Chopped, &SplitPoints, &SplitLength, intPrevValue);
4595                         
4596                 } else {
4597                         
4598                         SplitValues(wxSPropertySeg1Ptr, &SplitPoints, &SplitLength, intPrevValue);
4599                         
4600                 }
4601                 
4602                 for (std::map<int, int>::iterator intiter = SplitPoints.begin(); 
4603                 intiter != SplitPoints.end(); ++intiter){
4604                 
4605                         SLiter = SplitLength.find(intiter->first);
4606                 
4607                         if (ProcessItemData == TRUE){
4608                 
4609                                 if (FirstToken == TRUE){
4610                         
4611                                         PropertyData = wxSPropertySeg1Chopped.Mid((intPrevValue - 1), (SLiter->second));
4612                                         FirstToken = FALSE;
4613                         
4614                                 } else {
4615                                 
4616                                         PropertyData = wxSPropertySeg1Chopped.Mid((intPrevValue), (SLiter->second));
4617                                 
4618                                 }
4619                         
4620                         } else {                        
4621                                 
4622                                 if (FirstToken == TRUE){
4623                         
4624                                         PropertyData = wxSPropertySeg1Ptr->Mid((intPrevValue - 1), (SLiter->second));
4625                                         FirstToken = FALSE;
4626                         
4627                                 } else {
4628                                 
4629                                         PropertyData = wxSPropertySeg1Ptr->Mid((intPrevValue), (SLiter->second));
4630                                 
4631                                 }
4632                         
4633                         }
4634                         
4635                         wxStringTokenizer PropertyElement (PropertyData, wxT("="));
4636                         PropertyName = PropertyElement.GetNextToken();                          
4637                         PropertyValue = PropertyElement.GetNextToken();
4638                         
4639                         //ProcessCaptureStrings(&PropertyValue);
4640                         
4641                         intPrevValue = intiter->second;
4642                         
4643                         // Process properties.
4644                         
4645                         if (PropertyName.IsEmpty()){
4646                         
4647                                 continue;
4648                         
4649                         }
4650                         
4651                         if (PropertyDataMap->find(PropertyName) == PropertyDataMap->end()){
4653                                 PropertyDataMap->insert(std::make_pair(PropertyName, PropertyValue));
4654                                 PropertyLockMap->insert(std::make_pair(PropertyName, TRUE));
4655         
4656                         } else {
4657                         
4658                                 PropertyDataMap->erase(PropertyName);
4659                                 PropertyDataMap->insert(std::make_pair(PropertyName, PropertyValue));
4660                                 PropertyLockMap->erase(PropertyName);
4661                                 PropertyLockMap->insert(std::make_pair(PropertyName, TRUE));
4662                         
4663                         }
4664                 
4665                 }
4666         
4667         }
4668         
4669         // N
4670         
4671         if (wxSProperty == wxT("N")){
4672                 
4673                 int intPropertyLen;
4674                 
4675                 if (ProcessItemData == TRUE){
4676         
4677                         intPropertyLen = wxSPropertySeg1Chopped.Len();          
4678                 
4679                 } else {
4680                 
4681                         intPropertyLen = wxSPropertySeg1Ptr->Len();
4682                 
4683                 }
4684                 
4685                 std::map<int, int> SplitPoints;
4686                 std::map<int, int> SplitLength;
4687                 std::map<int, int>::iterator SLiter;                    
4688                 wxString PropertyData;
4689                 wxString PropertyName;
4690                 wxString PropertyValue;
4691                 wxString PropertyTokens;
4692                 bool AfterFirstToken = FALSE;
4693                 bool FirstToken = TRUE;         
4694                 int intSplitsFound = 0;
4695                 int intSplitSize = 0;
4696                 int intPrevValue = 3;
4697                 int intPref = 0;
4698                 int intType = 0;
4699                 int intSplitSeek = 0;
4701                 
4702                 wxSPropertyDataOut->Append(*wxSPropertySeg2Ptr);
4703                 *wxSPropertyDataNameOut = wxT("N");
4704                 *VCardV3Value = TRUE;
4705                 
4706                 if (ProcessItemData == TRUE){
4707                 
4708                         SplitValues(&wxSPropertySeg1Chopped, &SplitPoints, &SplitLength, intPrevValue);
4709                         
4710                 } else {
4711                         
4712                         SplitValues(wxSPropertySeg1Ptr, &SplitPoints, &SplitLength, intPrevValue);
4713                         
4714                 }
4715                 
4716                 for (std::map<int, int>::iterator intiter = SplitPoints.begin(); 
4717                 intiter != SplitPoints.end(); ++intiter){
4718                 
4719                         SLiter = SplitLength.find(intiter->first);
4720                 
4721                         if (ProcessItemData == TRUE){
4722                 
4723                                 if (FirstToken == TRUE){
4724                         
4725                                         PropertyData = wxSPropertySeg1Chopped.Mid((intPrevValue - 1), (SLiter->second));
4726                                         FirstToken = FALSE;
4727                         
4728                                 } else {
4729                                 
4730                                         PropertyData = wxSPropertySeg1Chopped.Mid((intPrevValue), (SLiter->second));
4731                                 
4732                                 }
4733                         
4734                         } else {                        
4735                                 
4736                                 if (FirstToken == TRUE){
4737                         
4738                                         PropertyData = wxSPropertySeg1Ptr->Mid((intPrevValue - 1), (SLiter->second));
4739                                         FirstToken = FALSE;
4740                         
4741                                 } else {
4742                                 
4743                                         PropertyData = wxSPropertySeg1Ptr->Mid((intPrevValue), (SLiter->second));
4744                                 
4745                                 }
4746                         
4747                         }
4748                         
4749                         wxStringTokenizer PropertyElement (PropertyData, wxT("="));
4750                         PropertyName = PropertyElement.GetNextToken();                          
4751                         PropertyValue = PropertyElement.GetNextToken();
4752                         
4753                         //ProcessCaptureStrings(&PropertyValue);
4754                         
4755                         intPrevValue = intiter->second;
4756                         
4757                         // Process properties.
4758                         
4759                         if (PropertyName.IsEmpty()){
4760                         
4761                                 continue;
4762                         
4763                         }
4764                         
4765                         if (PropertyDataMap->find(PropertyName) == PropertyDataMap->end()){
4767                                 PropertyDataMap->insert(std::make_pair(PropertyName, PropertyValue));
4768                                 PropertyLockMap->insert(std::make_pair(PropertyName, TRUE));
4769         
4770                         } else {
4771                         
4772                                 PropertyDataMap->erase(PropertyName);
4773                                 PropertyDataMap->insert(std::make_pair(PropertyName, PropertyValue));
4774                                 PropertyLockMap->erase(PropertyName);
4775                                 PropertyLockMap->insert(std::make_pair(PropertyName, TRUE));
4776                         
4777                         }
4778                 
4779                 }
4780         
4781         }
4782         
4783         // UID
4785         if (wxSProperty == wxT("UID")){
4786                 
4787                 int intPropertyLen;
4788                 
4789                 if (ProcessItemData == TRUE){
4790         
4791                         intPropertyLen = wxSPropertySeg1Chopped.Len();          
4792                 
4793                 } else {
4794                 
4795                         intPropertyLen = wxSPropertySeg1Ptr->Len();
4796                 
4797                 }
4798                 
4799                 std::map<int, int> SplitPoints;
4800                 std::map<int, int> SplitLength;
4801                 std::map<int, int>::iterator SLiter;                    
4802                 wxString PropertyData;
4803                 wxString PropertyName;
4804                 wxString PropertyValue;
4805                 wxString PropertyTokens;
4806                 bool AfterFirstToken = FALSE;
4807                 bool FirstToken = TRUE;         
4808                 int intSplitsFound = 0;
4809                 int intSplitSize = 0;
4810                 int intPrevValue = 5;
4811                 int intPref = 0;
4812                 int intType = 0;
4813                 int intSplitSeek = 0;
4815                 
4816                 wxSPropertyDataOut->Append(*wxSPropertySeg2Ptr);
4817                 *wxSPropertyDataNameOut = wxT("UID");
4818                 *VCardV3Value = TRUE;
4819                 
4820                 if (ProcessItemData == TRUE){
4821                 
4822                         SplitValues(&wxSPropertySeg1Chopped, &SplitPoints, &SplitLength, intPrevValue);
4823                         
4824                 } else {
4825                         
4826                         SplitValues(wxSPropertySeg1Ptr, &SplitPoints, &SplitLength, intPrevValue);
4827                         
4828                 }
4829                 
4830                 for (std::map<int, int>::iterator intiter = SplitPoints.begin(); 
4831                 intiter != SplitPoints.end(); ++intiter){
4832                 
4833                         SLiter = SplitLength.find(intiter->first);
4834                 
4835                         if (ProcessItemData == TRUE){
4836                 
4837                                 if (FirstToken == TRUE){
4838                         
4839                                         PropertyData = wxSPropertySeg1Chopped.Mid((intPrevValue - 1), (SLiter->second));
4840                                         FirstToken = FALSE;
4841                         
4842                                 } else {
4843                                 
4844                                         PropertyData = wxSPropertySeg1Chopped.Mid((intPrevValue), (SLiter->second));
4845                                 
4846                                 }
4847                         
4848                         } else {                        
4849                                 
4850                                 if (FirstToken == TRUE){
4851                         
4852                                         PropertyData = wxSPropertySeg1Ptr->Mid((intPrevValue - 1), (SLiter->second));
4853                                         FirstToken = FALSE;
4854                         
4855                                 } else {
4856                                 
4857                                         PropertyData = wxSPropertySeg1Ptr->Mid((intPrevValue), (SLiter->second));
4858                                 
4859                                 }
4860                         
4861                         }
4862                         
4863                         wxStringTokenizer PropertyElement (PropertyData, wxT("="));
4864                         PropertyName = PropertyElement.GetNextToken();                          
4865                         PropertyValue = PropertyElement.GetNextToken();
4866                         
4867                         //ProcessCaptureStrings(&PropertyValue);
4868                         
4869                         intPrevValue = intiter->second;
4870                         
4871                         // Process properties.
4873                         if (PropertyName.IsEmpty()){
4874                         
4875                                 continue;
4876                         
4877                         }
4878                                                 
4879                         if (PropertyDataMap->find(PropertyName) == PropertyDataMap->end()){
4881                                 PropertyDataMap->insert(std::make_pair(PropertyName, PropertyValue));
4882                                 PropertyLockMap->insert(std::make_pair(PropertyName, TRUE));
4883         
4884                         } else {
4885                         
4886                                 PropertyDataMap->erase(PropertyName);
4887                                 PropertyDataMap->insert(std::make_pair(PropertyName, PropertyValue));
4888                                 PropertyLockMap->erase(PropertyName);
4889                                 PropertyLockMap->insert(std::make_pair(PropertyName, TRUE));
4890                         
4891                         }
4892                 
4893                 }
4894         
4895         }
4896         
4897         // NICKNAME
4898         
4899         if (wxSProperty == wxT("NICKNAME")){
4900                 
4901                 int intPropertyLen;
4902                 
4903                 if (ProcessItemData == TRUE){
4904         
4905                         intPropertyLen = wxSPropertySeg1Chopped.Len();          
4906                 
4907                 } else {
4908                 
4909                         intPropertyLen = wxSPropertySeg1Ptr->Len();
4910                 
4911                 }
4912                 
4913                 std::map<int, int> SplitPoints;
4914                 std::map<int, int> SplitLength;
4915                 std::map<int, int>::iterator SLiter;                    
4916                 wxString PropertyData;
4917                 wxString PropertyName;
4918                 wxString PropertyValue;
4919                 wxString PropertyTokens;
4920                 bool AfterFirstToken = FALSE;
4921                 bool FirstToken = TRUE;         
4922                 int intSplitsFound = 0;
4923                 int intSplitSize = 0;
4924                 int intPrevValue = 10;
4925                 int intPref = 0;
4926                 int intType = 0;
4927                 int intSplitSeek = 0;
4929                 
4930                 wxSPropertyDataOut->Append(*wxSPropertySeg2Ptr);
4931                 *wxSPropertyDataNameOut = wxT("NICKNAME");
4932                 *VCardV3Value = TRUE;
4933                 
4934                 if (ProcessItemData == TRUE){
4935                 
4936                         SplitValues(&wxSPropertySeg1Chopped, &SplitPoints, &SplitLength, intPrevValue);
4937                         
4938                 } else {
4939                         
4940                         SplitValues(wxSPropertySeg1Ptr, &SplitPoints, &SplitLength, intPrevValue);
4941                         
4942                 }
4943                 
4944                 for (std::map<int, int>::iterator intiter = SplitPoints.begin(); 
4945                 intiter != SplitPoints.end(); ++intiter){
4946                 
4947                         SLiter = SplitLength.find(intiter->first);
4948                 
4949                         if (ProcessItemData == TRUE){
4950                 
4951                                 if (FirstToken == TRUE){
4952                         
4953                                         PropertyData = wxSPropertySeg1Chopped.Mid((intPrevValue - 1), (SLiter->second));
4954                                         FirstToken = FALSE;
4955                         
4956                                 } else {
4957                                 
4958                                         PropertyData = wxSPropertySeg1Chopped.Mid((intPrevValue), (SLiter->second));
4959                                 
4960                                 }
4961                         
4962                         } else {                        
4963                                 
4964                                 if (FirstToken == TRUE){
4965                         
4966                                         PropertyData = wxSPropertySeg1Ptr->Mid((intPrevValue - 1), (SLiter->second));
4967                                         FirstToken = FALSE;
4968                         
4969                                 } else {
4970                                 
4971                                         PropertyData = wxSPropertySeg1Ptr->Mid((intPrevValue), (SLiter->second));
4972                                 
4973                                 }
4974                         
4975                         }
4976                         
4977                         wxStringTokenizer PropertyElement (PropertyData, wxT("="));
4978                         PropertyName = PropertyElement.GetNextToken();                          
4979                         PropertyValue = PropertyElement.GetNextToken();
4980                         
4981                         //ProcessCaptureStrings(&PropertyValue);
4982                         
4983                         intPrevValue = intiter->second;
4984                         
4985                         // Process properties.
4987                         if (PropertyName.IsEmpty()){
4988                         
4989                                 continue;
4990                         
4991                         }
4992                                                 
4993                         if (PropertyDataMap->find(PropertyName) == PropertyDataMap->end()){
4995                                 PropertyDataMap->insert(std::make_pair(PropertyName, PropertyValue));
4996                                 PropertyLockMap->insert(std::make_pair(PropertyName, TRUE));
4997         
4998                         } else {
4999                         
5000                                 PropertyDataMap->erase(PropertyName);
5001                                 PropertyDataMap->insert(std::make_pair(PropertyName, PropertyValue));
5002                                 PropertyLockMap->erase(PropertyName);
5003                                 PropertyLockMap->insert(std::make_pair(PropertyName, TRUE));
5004                         
5005                         }
5006                 
5007                 }
5008         
5009         }
5010         
5011         // GENDER
5012         
5013         if (wxSProperty == wxT("GENDER")){
5014                 
5015                 int intPropertyLen;
5016                 
5017                 if (ProcessItemData == TRUE){
5018         
5019                         intPropertyLen = wxSPropertySeg1Chopped.Len();          
5020                 
5021                 } else {
5022                 
5023                         intPropertyLen = wxSPropertySeg1Ptr->Len();
5024                 
5025                 }
5026                 
5027                 std::map<int, int> SplitPoints;
5028                 std::map<int, int> SplitLength;
5029                 std::map<int, int>::iterator SLiter;                    
5030                 wxString PropertyData;
5031                 wxString PropertyName;
5032                 wxString PropertyValue;
5033                 wxString PropertyTokens;
5034                 bool AfterFirstToken = FALSE;
5035                 bool FirstToken = TRUE;         
5036                 int intSplitsFound = 0;
5037                 int intSplitSize = 0;
5038                 int intPrevValue = 8;
5039                 int intPref = 0;
5040                 int intType = 0;
5041                 int intSplitSeek = 0;
5043                 
5044                 wxSPropertyDataOut->Append(*wxSPropertySeg2Ptr);
5045                 *wxSPropertyDataNameOut = wxT("GENDER");
5046                 *VCardV3Value = TRUE;
5047                 
5048                 if (ProcessItemData == TRUE){
5049                 
5050                         SplitValues(&wxSPropertySeg1Chopped, &SplitPoints, &SplitLength, intPrevValue);
5051                         
5052                 } else {
5053                         
5054                         SplitValues(wxSPropertySeg1Ptr, &SplitPoints, &SplitLength, intPrevValue);
5055                         
5056                 }
5057                 
5058                 for (std::map<int, int>::iterator intiter = SplitPoints.begin(); 
5059                 intiter != SplitPoints.end(); ++intiter){
5060                 
5061                         SLiter = SplitLength.find(intiter->first);
5062                 
5063                         if (ProcessItemData == TRUE){
5064                 
5065                                 if (FirstToken == TRUE){
5066                         
5067                                         PropertyData = wxSPropertySeg1Chopped.Mid((intPrevValue - 1), (SLiter->second));
5068                                         FirstToken = FALSE;
5069                         
5070                                 } else {
5071                                 
5072                                         PropertyData = wxSPropertySeg1Chopped.Mid((intPrevValue), (SLiter->second));
5073                                 
5074                                 }
5075                         
5076                         } else {                        
5077                                 
5078                                 if (FirstToken == TRUE){
5079                         
5080                                         PropertyData = wxSPropertySeg1Ptr->Mid((intPrevValue - 1), (SLiter->second));
5081                                         FirstToken = FALSE;
5082                         
5083                                 } else {
5084                                 
5085                                         PropertyData = wxSPropertySeg1Ptr->Mid((intPrevValue), (SLiter->second));
5086                                 
5087                                 }
5088                         
5089                         }
5090                         
5091                         wxStringTokenizer PropertyElement (PropertyData, wxT("="));
5092                         PropertyName = PropertyElement.GetNextToken();                          
5093                         PropertyValue = PropertyElement.GetNextToken();
5094                         
5095                         //ProcessCaptureStrings(&PropertyValue);
5096                         
5097                         intPrevValue = intiter->second;
5098                         
5099                         // Process properties.
5100                         
5101                         if (PropertyName.IsEmpty()){
5102                         
5103                                 continue;
5104                         
5105                         }
5106                         
5107                         if (PropertyDataMap->find(PropertyName) == PropertyDataMap->end()){
5109                                 PropertyDataMap->insert(std::make_pair(PropertyName, PropertyValue));
5110                                 PropertyLockMap->insert(std::make_pair(PropertyName, TRUE));
5111         
5112                         } else {
5113                         
5114                                 PropertyDataMap->erase(PropertyName);
5115                                 PropertyDataMap->insert(std::make_pair(PropertyName, PropertyValue));
5116                                 PropertyLockMap->erase(PropertyName);
5117                                 PropertyLockMap->insert(std::make_pair(PropertyName, TRUE));
5118                         
5119                         }
5120                 
5121                 }
5122         
5123         }
5124         
5125         // BDAY
5126         
5127         if (wxSProperty == wxT("BDAY")){
5128                 
5129                 int intPropertyLen;
5130                 
5131                 if (ProcessItemData == TRUE){
5132         
5133                         intPropertyLen = wxSPropertySeg1Chopped.Len();          
5134                 
5135                 } else {
5136                 
5137                         intPropertyLen = wxSPropertySeg1Ptr->Len();
5138                 
5139                 }
5140                 
5141                 std::map<int, int> SplitPoints;
5142                 std::map<int, int> SplitLength;
5143                 std::map<int, int>::iterator SLiter;                    
5144                 wxString PropertyData;
5145                 wxString PropertyName;
5146                 wxString PropertyValue;
5147                 wxString PropertyTokens;
5148                 wxString PropertyXOmitYear;
5149                 bool AfterFirstToken = FALSE;
5150                 bool FirstToken = TRUE;         
5151                 int intSplitsFound = 0;
5152                 int intSplitSize = 0;
5153                 int intPrevValue = 6;
5154                 int intPref = 0;
5155                 int intType = 0;
5156                 int intSplitSeek = 0;
5158                 
5159                 *wxSPropertyDataNameOut = wxT("BDAY");
5160                 *VCardV3Value = TRUE;
5161                 
5162                 if (ProcessItemData == TRUE){
5163                 
5164                         SplitValues(&wxSPropertySeg1Chopped, &SplitPoints, &SplitLength, intPrevValue);
5165                         
5166                 } else {
5167                         
5168                         SplitValues(wxSPropertySeg1Ptr, &SplitPoints, &SplitLength, intPrevValue);
5169                         
5170                 }
5171                 
5172                 for (std::map<int, int>::iterator intiter = SplitPoints.begin(); 
5173                 intiter != SplitPoints.end(); ++intiter){
5174                 
5175                         SLiter = SplitLength.find(intiter->first);
5176                 
5177                         if (ProcessItemData == TRUE){
5178                 
5179                                 if (FirstToken == TRUE){
5180                         
5181                                         PropertyData = wxSPropertySeg1Chopped.Mid((intPrevValue - 1), (SLiter->second));
5182                                         FirstToken = FALSE;
5183                         
5184                                 } else {
5185                                 
5186                                         PropertyData = wxSPropertySeg1Chopped.Mid((intPrevValue), (SLiter->second));
5187                                 
5188                                 }
5189                         
5190                         } else {                        
5191                                 
5192                                 if (FirstToken == TRUE){
5193                         
5194                                         PropertyData = wxSPropertySeg1Ptr->Mid((intPrevValue - 1), (SLiter->second));
5195                                         FirstToken = FALSE;
5196                         
5197                                 } else {
5198                                 
5199                                         PropertyData = wxSPropertySeg1Ptr->Mid((intPrevValue), (SLiter->second));
5200                                 
5201                                 }
5202                         
5203                         }
5204                         
5205                         wxStringTokenizer PropertyElement (PropertyData, wxT("="));
5206                         PropertyName = PropertyElement.GetNextToken();                          
5207                         PropertyValue = PropertyElement.GetNextToken();
5208                         
5209                         //ProcessCaptureStrings(&PropertyValue);
5210                         
5211                         intPrevValue = intiter->second;
5212                         
5213                         if (PropertyName == wxT("X-APPLE-OMIT-YEAR")){
5214                                 PropertyXOmitYear = PropertyValue;
5215                         }
5216                         
5217                         // Process properties.
5218                         
5219                         if (PropertyName.IsEmpty()){
5220                         
5221                                 continue;
5222                         
5223                         }
5224                         
5225                         if (PropertyDataMap->find(PropertyName) == PropertyDataMap->end()){
5227                                 PropertyDataMap->insert(std::make_pair(PropertyName, PropertyValue));
5228                                 PropertyLockMap->insert(std::make_pair(PropertyName, TRUE));
5229         
5230                         } else {
5231                         
5232                                 PropertyDataMap->erase(PropertyName);
5233                                 PropertyDataMap->insert(std::make_pair(PropertyName, PropertyValue));
5234                                 PropertyLockMap->erase(PropertyName);
5235                                 PropertyLockMap->insert(std::make_pair(PropertyName, TRUE));
5236                         
5237                         }
5238                 
5239                 }
5240                 
5241                 // Convert the date from YYYY-MM-DD to YYYYMMDD or --MMDD depending on if the
5242                 // year matches the X-APPLE-OMIT-YEAR value.
5243                 
5244                 wxStringTokenizer DateSplit(*wxSPropertySeg2Ptr, wxT("-"));
5245                 
5246                 wxString DateProc;
5247                 wxString FinalDate;
5248                 
5249                 DateProc = DateSplit.GetNextToken();
5250                 
5251                 if (DateProc == PropertyXOmitYear){
5252                 
5253                         FinalDate.Append(wxT("--"));
5254                 
5255                 } else {
5256                 
5257                         FinalDate.Append(DateProc);
5258                 
5259                 }
5260                 
5261                 DateProc.clear();
5262                 DateProc = DateSplit.GetNextToken();
5263                 
5264                 FinalDate.Append(DateProc);
5266                 DateProc.clear();
5267                 DateProc = DateSplit.GetNextToken();            
5268                 
5269                 FinalDate.Append(DateProc);
5270                 
5271                 wxSPropertyDataOut->Append(FinalDate);
5272         
5273         }
5274         
5275         // ANNIVERSARY
5276         
5277         if (wxSProperty == wxT("ANNIVERSARY")){
5278                 
5279                 int intPropertyLen;
5280                 
5281                 if (ProcessItemData == TRUE){
5282         
5283                         intPropertyLen = wxSPropertySeg1Chopped.Len();          
5284                 
5285                 } else {
5286                 
5287                         intPropertyLen = wxSPropertySeg1Ptr->Len();
5288                 
5289                 }
5290                 
5291                 std::map<int, int> SplitPoints;
5292                 std::map<int, int> SplitLength;
5293                 std::map<int, int>::iterator SLiter;                    
5294                 wxString PropertyData;
5295                 wxString PropertyName;
5296                 wxString PropertyValue;
5297                 wxString PropertyTokens;
5298                 wxString PropertyXOmitYear;
5299                 bool AfterFirstToken = FALSE;
5300                 bool FirstToken = TRUE;         
5301                 int intSplitsFound = 0;
5302                 int intSplitSize = 0;
5303                 int intPrevValue = 13;
5304                 int intPref = 0;
5305                 int intType = 0;
5306                 int intSplitSeek = 0;
5308                 
5309                 *wxSPropertyDataNameOut = wxT("ANNIVERSARY");
5310                 *VCardV3Value = TRUE;
5311                 
5312                 if (ProcessItemData == TRUE){
5313                 
5314                         SplitValues(&wxSPropertySeg1Chopped, &SplitPoints, &SplitLength, intPrevValue);
5315                         
5316                 } else {
5317                         
5318                         SplitValues(wxSPropertySeg1Ptr, &SplitPoints, &SplitLength, intPrevValue);
5319                         
5320                 }
5321                 
5322                 for (std::map<int, int>::iterator intiter = SplitPoints.begin(); 
5323                 intiter != SplitPoints.end(); ++intiter){
5324                 
5325                         SLiter = SplitLength.find(intiter->first);
5326                 
5327                         if (ProcessItemData == TRUE){
5328                 
5329                                 if (FirstToken == TRUE){
5330                         
5331                                         PropertyData = wxSPropertySeg1Chopped.Mid((intPrevValue - 1), (SLiter->second));
5332                                         FirstToken = FALSE;
5333                         
5334                                 } else {
5335                                 
5336                                         PropertyData = wxSPropertySeg1Chopped.Mid((intPrevValue), (SLiter->second));
5337                                 
5338                                 }
5339                         
5340                         } else {                        
5341                                 
5342                                 if (FirstToken == TRUE){
5343                         
5344                                         PropertyData = wxSPropertySeg1Ptr->Mid((intPrevValue - 1), (SLiter->second));
5345                                         FirstToken = FALSE;
5346                         
5347                                 } else {
5348                                 
5349                                         PropertyData = wxSPropertySeg1Ptr->Mid((intPrevValue), (SLiter->second));
5350                                 
5351                                 }
5352                         
5353                         }
5354                         
5355                         wxStringTokenizer PropertyElement (PropertyData, wxT("="));
5356                         PropertyName = PropertyElement.GetNextToken();                          
5357                         PropertyValue = PropertyElement.GetNextToken();
5358                         
5359                         //ProcessCaptureStrings(&PropertyValue);
5360                         
5361                         intPrevValue = intiter->second;
5362                         
5363                         if (PropertyName == wxT("X-APPLE-OMIT-YEAR")){
5364                                 PropertyXOmitYear = PropertyValue;
5365                         }
5366                         
5367                         // Process properties.
5368                         
5369                         if (PropertyName.IsEmpty()){
5370                         
5371                                 continue;
5372                         
5373                         }
5374                         
5375                         if (PropertyDataMap->find(PropertyName) == PropertyDataMap->end()){
5377                                 PropertyDataMap->insert(std::make_pair(PropertyName, PropertyValue));
5378                                 PropertyLockMap->insert(std::make_pair(PropertyName, TRUE));
5379         
5380                         } else {
5381                         
5382                                 PropertyDataMap->erase(PropertyName);
5383                                 PropertyDataMap->insert(std::make_pair(PropertyName, PropertyValue));
5384                                 PropertyLockMap->erase(PropertyName);
5385                                 PropertyLockMap->insert(std::make_pair(PropertyName, TRUE));
5386                         
5387                         }
5388                 
5389                 }
5390                 
5391                 // Convert the date from YYYY-MM-DD to YYYYMMDD or --MMDD depending on if the
5392                 // year matches the X-APPLE-OMIT-YEAR value.
5393                 
5394                 wxStringTokenizer DateSplit(*wxSPropertySeg2Ptr, wxT("-"));
5395                 
5396                 wxString DateProc;
5397                 wxString FinalDate;
5398                 
5399                 DateProc = DateSplit.GetNextToken();
5400                 
5401                 if (DateProc == PropertyXOmitYear){
5402                 
5403                         FinalDate.Append(wxT("--"));
5404                 
5405                 } else {
5406                 
5407                         FinalDate.Append(DateProc);
5408                 
5409                 }
5410                 
5411                 DateProc.clear();
5412                 DateProc = DateSplit.GetNextToken();
5413                 
5414                 FinalDate.Append(DateProc);
5416                 DateProc.clear();
5417                 DateProc = DateSplit.GetNextToken();            
5418                 
5419                 FinalDate.Append(DateProc);
5420                 
5421                 wxSPropertyDataOut->Append(FinalDate);
5422         
5423         }
5424         
5425         // TZ - Not sure how to process this correctly. So data
5426         // is kept as X-VCARD3-TZ for the time being.
5427         
5428         if (wxSProperty == wxT("TZ")){
5429                 
5430                 int intPropertyLen;
5431                 
5432                 if (ProcessItemData == TRUE){
5433         
5434                         intPropertyLen = wxSPropertySeg1Chopped.Len();          
5435                 
5436                 } else {
5437                 
5438                         intPropertyLen = wxSPropertySeg1Ptr->Len();
5439                 
5440                 }
5441                 
5442                 std::map<int, int> SplitPoints;
5443                 std::map<int, int> SplitLength;
5444                 std::map<int, int>::iterator SLiter;                    
5445                 wxString PropertyData;
5446                 wxString PropertyName;
5447                 wxString PropertyValue;
5448                 wxString PropertyTokens;
5449                 wxString PropertyXOmitYear;
5450                 bool AfterFirstToken = FALSE;
5451                 bool FirstToken = TRUE;         
5452                 int intSplitsFound = 0;
5453                 int intSplitSize = 0;
5454                 int intPrevValue = 4;
5455                 int intPref = 0;
5456                 int intType = 0;
5457                 int intSplitSeek = 0;
5459                 
5460                 wxSPropertyDataOut->Append(*wxSPropertySeg2Ptr);
5461                 *wxSPropertyDataNameOut = wxT("X-VCARD3-TZ");
5462                 *VCardV3Value = TRUE;
5463                 
5464                 if (ProcessItemData == TRUE){
5465                 
5466                         SplitValues(&wxSPropertySeg1Chopped, &SplitPoints, &SplitLength, intPrevValue);
5467                         
5468                 } else {
5469                         
5470                         SplitValues(wxSPropertySeg1Ptr, &SplitPoints, &SplitLength, intPrevValue);
5471                         
5472                 }
5473                 
5474                 for (std::map<int, int>::iterator intiter = SplitPoints.begin(); 
5475                 intiter != SplitPoints.end(); ++intiter){
5476                 
5477                         SLiter = SplitLength.find(intiter->first);
5478                 
5479                         if (ProcessItemData == TRUE){
5480                 
5481                                 if (FirstToken == TRUE){
5482                         
5483                                         PropertyData = wxSPropertySeg1Chopped.Mid((intPrevValue - 1), (SLiter->second));
5484                                         FirstToken = FALSE;
5485                         
5486                                 } else {
5487                                 
5488                                         PropertyData = wxSPropertySeg1Chopped.Mid((intPrevValue), (SLiter->second));
5489                                 
5490                                 }
5491                         
5492                         } else {                        
5493                                 
5494                                 if (FirstToken == TRUE){
5495                         
5496                                         PropertyData = wxSPropertySeg1Ptr->Mid((intPrevValue - 1), (SLiter->second));
5497                                         FirstToken = FALSE;
5498                         
5499                                 } else {
5500                                 
5501                                         PropertyData = wxSPropertySeg1Ptr->Mid((intPrevValue), (SLiter->second));
5502                                 
5503                                 }
5504                         
5505                         }
5506                         
5507                         wxStringTokenizer PropertyElement (PropertyData, wxT("="));
5508                         PropertyName = PropertyElement.GetNextToken();                          
5509                         PropertyValue = PropertyElement.GetNextToken();
5510                         
5511                         //ProcessCaptureStrings(&PropertyValue);
5512                         
5513                         intPrevValue = intiter->second;
5514                         
5515                         // Process properties.
5516                         
5517                         if (PropertyName.IsEmpty()){
5518                         
5519                                 continue;
5520                         
5521                         }
5522                         
5523                         if (PropertyDataMap->find(PropertyName) == PropertyDataMap->end()){
5525                                 PropertyDataMap->insert(std::make_pair(PropertyName, PropertyValue));
5526                                 PropertyLockMap->insert(std::make_pair(PropertyName, TRUE));
5527         
5528                         } else {
5529                         
5530                                 PropertyDataMap->erase(PropertyName);
5531                                 PropertyDataMap->insert(std::make_pair(PropertyName, PropertyValue));
5532                                 PropertyLockMap->erase(PropertyName);
5533                                 PropertyLockMap->insert(std::make_pair(PropertyName, TRUE));
5534                         
5535                         }
5536                 
5537                 }
5538         
5539         }
5540         
5541         // ROLE
5542         
5543         if (wxSProperty == wxT("ROLE")){
5544                 
5545                 int intPropertyLen;
5546                 
5547                 if (ProcessItemData == TRUE){
5548         
5549                         intPropertyLen = wxSPropertySeg1Chopped.Len();          
5550                 
5551                 } else {
5552                 
5553                         intPropertyLen = wxSPropertySeg1Ptr->Len();
5554                 
5555                 }
5556                 
5557                 std::map<int, int> SplitPoints;
5558                 std::map<int, int> SplitLength;
5559                 std::map<int, int>::iterator SLiter;                    
5560                 wxString PropertyData;
5561                 wxString PropertyName;
5562                 wxString PropertyValue;
5563                 wxString PropertyTokens;
5564                 wxString PropertyXOmitYear;
5565                 bool AfterFirstToken = FALSE;
5566                 bool FirstToken = TRUE;         
5567                 int intSplitsFound = 0;
5568                 int intSplitSize = 0;
5569                 int intPrevValue = 6;
5570                 int intPref = 0;
5571                 int intType = 0;
5572                 int intSplitSeek = 0;
5574                 
5575                 wxSPropertyDataOut->Append(*wxSPropertySeg2Ptr);
5576                 *wxSPropertyDataNameOut = wxT("ROLE");
5577                 *VCardV3Value = TRUE;
5578                 
5579                 if (ProcessItemData == TRUE){
5580                 
5581                         SplitValues(&wxSPropertySeg1Chopped, &SplitPoints, &SplitLength, intPrevValue);
5582                         
5583                 } else {
5584                         
5585                         SplitValues(wxSPropertySeg1Ptr, &SplitPoints, &SplitLength, intPrevValue);
5586                         
5587                 }
5588                 
5589                 for (std::map<int, int>::iterator intiter = SplitPoints.begin(); 
5590                 intiter != SplitPoints.end(); ++intiter){
5591                 
5592                         SLiter = SplitLength.find(intiter->first);
5593                 
5594                         if (ProcessItemData == TRUE){
5595                 
5596                                 if (FirstToken == TRUE){
5597                         
5598                                         PropertyData = wxSPropertySeg1Chopped.Mid((intPrevValue - 1), (SLiter->second));
5599                                         FirstToken = FALSE;
5600                         
5601                                 } else {
5602                                 
5603                                         PropertyData = wxSPropertySeg1Chopped.Mid((intPrevValue), (SLiter->second));
5604                                 
5605                                 }
5606                         
5607                         } else {                        
5608                                 
5609                                 if (FirstToken == TRUE){
5610                         
5611                                         PropertyData = wxSPropertySeg1Ptr->Mid((intPrevValue - 1), (SLiter->second));
5612                                         FirstToken = FALSE;
5613                         
5614                                 } else {
5615                                 
5616                                         PropertyData = wxSPropertySeg1Ptr->Mid((intPrevValue), (SLiter->second));
5617                                 
5618                                 }
5619                         
5620                         }
5621                         
5622                         wxStringTokenizer PropertyElement (PropertyData, wxT("="));
5623                         PropertyName = PropertyElement.GetNextToken();                          
5624                         PropertyValue = PropertyElement.GetNextToken();
5625                         
5626                         //ProcessCaptureStrings(&PropertyValue);
5627                         
5628                         intPrevValue = intiter->second;
5629                         
5630                         // Process properties.
5631                         
5632                         if (PropertyName.IsEmpty()){
5633                         
5634                                 continue;
5635                         
5636                         }
5637                         
5638                         if (PropertyDataMap->find(PropertyName) == PropertyDataMap->end()){
5640                                 PropertyDataMap->insert(std::make_pair(PropertyName, PropertyValue));
5641                                 PropertyLockMap->insert(std::make_pair(PropertyName, TRUE));
5642         
5643                         } else {
5644                         
5645                                 PropertyDataMap->erase(PropertyName);
5646                                 PropertyDataMap->insert(std::make_pair(PropertyName, PropertyValue));
5647                                 PropertyLockMap->erase(PropertyName);
5648                                 PropertyLockMap->insert(std::make_pair(PropertyName, TRUE));
5649                         
5650                         }
5651                 
5652                 }
5653         
5654         }
5655         
5656         // ORG
5657         
5658         if (wxSProperty == wxT("ORG")){
5659                 
5660                 int intPropertyLen;
5661                 
5662                 if (ProcessItemData == TRUE){
5663         
5664                         intPropertyLen = wxSPropertySeg1Chopped.Len();          
5665                 
5666                 } else {
5667                 
5668                         intPropertyLen = wxSPropertySeg1Ptr->Len();
5669                 
5670                 }
5671                 
5672                 std::map<int, int> SplitPoints;
5673                 std::map<int, int> SplitLength;
5674                 std::map<int, int>::iterator SLiter;                    
5675                 wxString PropertyData;
5676                 wxString PropertyName;
5677                 wxString PropertyValue;
5678                 wxString PropertyTokens;
5679                 wxString PropertyXOmitYear;
5680                 bool AfterFirstToken = FALSE;
5681                 bool FirstToken = TRUE;         
5682                 int intSplitsFound = 0;
5683                 int intSplitSize = 0;
5684                 int intPrevValue = 5;
5685                 int intPref = 0;
5686                 int intType = 0;
5687                 int intSplitSeek = 0;
5689                 
5690                 wxSPropertyDataOut->Append(*wxSPropertySeg2Ptr);
5691                 *wxSPropertyDataNameOut = wxT("ORG");
5692                 *VCardV3Value = TRUE;
5693                 
5694                 if (ProcessItemData == TRUE){
5695                 
5696                         SplitValues(&wxSPropertySeg1Chopped, &SplitPoints, &SplitLength, intPrevValue);
5697                         
5698                 } else {
5699                         
5700                         SplitValues(wxSPropertySeg1Ptr, &SplitPoints, &SplitLength, intPrevValue);
5701                         
5702                 }
5703                 
5704                 for (std::map<int, int>::iterator intiter = SplitPoints.begin(); 
5705                 intiter != SplitPoints.end(); ++intiter){
5706                 
5707                         SLiter = SplitLength.find(intiter->first);
5708                 
5709                         if (ProcessItemData == TRUE){
5710                 
5711                                 if (FirstToken == TRUE){
5712                         
5713                                         PropertyData = wxSPropertySeg1Chopped.Mid((intPrevValue - 1), (SLiter->second));
5714                                         FirstToken = FALSE;
5715                         
5716                                 } else {
5717                                 
5718                                         PropertyData = wxSPropertySeg1Chopped.Mid((intPrevValue), (SLiter->second));
5719                                 
5720                                 }
5721                         
5722                         } else {                        
5723                                 
5724                                 if (FirstToken == TRUE){
5725                         
5726                                         PropertyData = wxSPropertySeg1Ptr->Mid((intPrevValue - 1), (SLiter->second));
5727                                         FirstToken = FALSE;
5728                         
5729                                 } else {
5730                                 
5731                                         PropertyData = wxSPropertySeg1Ptr->Mid((intPrevValue), (SLiter->second));
5732                                 
5733                                 }
5734                         
5735                         }
5736                         
5737                         wxStringTokenizer PropertyElement (PropertyData, wxT("="));
5738                         PropertyName = PropertyElement.GetNextToken();                          
5739                         PropertyValue = PropertyElement.GetNextToken();
5740                         
5741                         //ProcessCaptureStrings(&PropertyValue);
5742                         
5743                         intPrevValue = intiter->second;
5744                         
5745                         // Process properties.
5746                         
5747                         if (PropertyName.IsEmpty()){
5748                         
5749                                 continue;
5750                         
5751                         }
5752                         
5753                         if (PropertyDataMap->find(PropertyName) == PropertyDataMap->end()){
5755                                 PropertyDataMap->insert(std::make_pair(PropertyName, PropertyValue));
5756                                 PropertyLockMap->insert(std::make_pair(PropertyName, TRUE));
5757         
5758                         } else {
5759                         
5760                                 PropertyDataMap->erase(PropertyName);
5761                                 PropertyDataMap->insert(std::make_pair(PropertyName, PropertyValue));
5762                                 PropertyLockMap->erase(PropertyName);
5763                                 PropertyLockMap->insert(std::make_pair(PropertyName, TRUE));
5764                         
5765                         }
5766                 
5767                 }
5768         
5769         }
5770         
5771         // NOTE
5772         
5773         if (wxSProperty == wxT("NOTE")){
5774                 
5775                 int intPropertyLen;
5776                 
5777                 if (ProcessItemData == TRUE){
5778         
5779                         intPropertyLen = wxSPropertySeg1Chopped.Len();          
5780                 
5781                 } else {
5782                 
5783                         intPropertyLen = wxSPropertySeg1Ptr->Len();
5784                 
5785                 }
5786                 
5787                 std::map<int, int> SplitPoints;
5788                 std::map<int, int> SplitLength;
5789                 std::map<int, int>::iterator SLiter;                    
5790                 wxString PropertyData;
5791                 wxString PropertyName;
5792                 wxString PropertyValue;
5793                 wxString PropertyTokens;
5794                 wxString PropertyXOmitYear;
5795                 bool AfterFirstToken = FALSE;
5796                 bool FirstToken = TRUE;         
5797                 int intSplitsFound = 0;
5798                 int intSplitSize = 0;
5799                 int intPrevValue = 6;
5800                 int intPref = 0;
5801                 int intType = 0;
5802                 int intSplitSeek = 0;
5804                 
5805                 wxSPropertyDataOut->Append(*wxSPropertySeg2Ptr);
5806                 *wxSPropertyDataNameOut = wxT("NOTE");
5807                 *VCardV3Value = TRUE;
5808                 
5809                 if (ProcessItemData == TRUE){
5810                 
5811                         SplitValues(&wxSPropertySeg1Chopped, &SplitPoints, &SplitLength, intPrevValue);
5812                         
5813                 } else {
5814                         
5815                         SplitValues(wxSPropertySeg1Ptr, &SplitPoints, &SplitLength, intPrevValue);
5816                         
5817                 }
5818                 
5819                 for (std::map<int, int>::iterator intiter = SplitPoints.begin(); 
5820                 intiter != SplitPoints.end(); ++intiter){
5821                 
5822                         SLiter = SplitLength.find(intiter->first);
5823                 
5824                         if (ProcessItemData == TRUE){
5825                 
5826                                 if (FirstToken == TRUE){
5827                         
5828                                         PropertyData = wxSPropertySeg1Chopped.Mid((intPrevValue - 1), (SLiter->second));
5829                                         FirstToken = FALSE;
5830                         
5831                                 } else {
5832                                 
5833                                         PropertyData = wxSPropertySeg1Chopped.Mid((intPrevValue), (SLiter->second));
5834                                 
5835                                 }
5836                         
5837                         } else {                        
5838                                 
5839                                 if (FirstToken == TRUE){
5840                         
5841                                         PropertyData = wxSPropertySeg1Ptr->Mid((intPrevValue - 1), (SLiter->second));
5842                                         FirstToken = FALSE;
5843                         
5844                                 } else {
5845                                 
5846                                         PropertyData = wxSPropertySeg1Ptr->Mid((intPrevValue), (SLiter->second));
5847                                 
5848                                 }
5849                         
5850                         }
5851                         
5852                         wxStringTokenizer PropertyElement (PropertyData, wxT("="));
5853                         PropertyName = PropertyElement.GetNextToken();                          
5854                         PropertyValue = PropertyElement.GetNextToken();
5855                         
5856                         //ProcessCaptureStrings(&PropertyValue);
5857                         
5858                         intPrevValue = intiter->second;
5859                         
5860                         // Process properties.
5861                         
5862                         if (PropertyName.IsEmpty()){
5863                         
5864                                 continue;
5865                         
5866                         }
5867                         
5868                         if (PropertyDataMap->find(PropertyName) == PropertyDataMap->end()){
5870                                 PropertyDataMap->insert(std::make_pair(PropertyName, PropertyValue));
5871                                 PropertyLockMap->insert(std::make_pair(PropertyName, TRUE));
5872         
5873                         } else {
5874                         
5875                                 PropertyDataMap->erase(PropertyName);
5876                                 PropertyDataMap->insert(std::make_pair(PropertyName, PropertyValue));
5877                                 PropertyLockMap->erase(PropertyName);
5878                                 PropertyLockMap->insert(std::make_pair(PropertyName, TRUE));
5879                         
5880                         }
5881                 
5882                 }
5883         
5884         }
5885         
5886         // PHOTO
5887         
5888         if (wxSProperty == wxT("PHOTO")){
5889                 
5890                 int intPropertyLen;
5891                 
5892                 if (ProcessItemData == TRUE){
5893         
5894                         intPropertyLen = wxSPropertySeg1Chopped.Len();          
5895                 
5896                 } else {
5897                 
5898                         intPropertyLen = wxSPropertySeg1Ptr->Len();
5899                 
5900                 }
5901                 
5902                 std::map<int, int> SplitPoints;
5903                 std::map<int, int> SplitLength;
5904                 std::map<int, int>::iterator SLiter;
5905                 std::map<wxString, wxString> SplitData;                         
5906                 wxString PropertyData;
5907                 wxString PropertyName;
5908                 wxString PropertyValue;
5909                 wxString PropertyTokens;
5910                 wxString PropertyXOmitYear;
5911                 bool AfterFirstToken = FALSE;
5912                 bool FirstToken = TRUE;         
5913                 int intSplitsFound = 0;
5914                 int intSplitSize = 0;
5915                 int intPrevValue = 7;
5916                 int intPref = 0;
5917                 int intType = 0;
5918                 int intSplitSeek = 0;
5920                 
5921                 *wxSPropertyDataNameOut = wxT("PHOTO");
5922                 *VCardV3Value = TRUE;
5923                 
5924                 if (ProcessItemData == TRUE){
5925                 
5926                         SplitValuesData(&wxSPropertySeg1Chopped, &SplitPoints, &SplitLength, intPrevValue, &SplitData);
5927                         
5928                 } else {
5929                         
5930                         SplitValuesData(wxSPropertySeg1Ptr, &SplitPoints, &SplitLength, intPrevValue, &SplitData);
5931                         
5932                 }
5933                 
5934                 wxString wxSMIMEType;
5935                 wxString wxSEncType;
5936                 
5937                 for (std::map<wxString, wxString>::iterator intiter = SplitData.begin();
5938                 intiter != SplitData.end(); ++intiter){
5939                 
5940                         PropertyName = intiter->first;                          
5941                         PropertyValue = intiter->second;
5943                         if (PropertyName == wxT("ENCODING") && PropertyValue == wxT("b")){
5944                                 wxSEncType = wxT("base64");
5945                                 continue;
5946                         }
5947                         
5948                         if ((PropertyName == wxT("TYPE") || PropertyName == wxT("type")) && PropertyValue == wxT("PNG")){
5949                                 wxSMIMEType = wxT("image/png");
5950                                 continue;
5951                         } else if ((PropertyName == wxT("TYPE") || PropertyName == wxT("type")) && PropertyValue == wxT("JPEG")){
5952                                 wxSMIMEType = wxT("image/jpeg");
5953                                 continue;
5954                         } else if ((PropertyName == wxT("TYPE") || PropertyName == wxT("type")) && PropertyValue == wxT("GIF")){
5955                                 wxSMIMEType = wxT("image/gif");
5956                                 continue;
5957                         } else if ((PropertyName == wxT("TYPE") || PropertyName == wxT("type")) && PropertyValue == wxT("BMP")){
5958                                 wxSMIMEType = wxT("image/bmp");
5959                                 continue;
5960                         } else if (PropertyName == wxT("TYPE") || PropertyName == wxT("type")) {
5961                                 wxSMIMEType = wxT("image/unknown");
5962                                 continue;
5963                         }
5964                         
5965                         //intPrevValue = intiter->second;
5966                         
5967                         // Process properties.
5968                         
5969                         if (PropertyName.IsEmpty()){
5970                         
5971                                 continue;
5972                         
5973                         }
5974                         
5975                         if (PropertyDataMap->find(PropertyName) == PropertyDataMap->end()){
5977                                 PropertyDataMap->insert(std::make_pair(PropertyName, PropertyValue));
5978                                 PropertyLockMap->insert(std::make_pair(PropertyName, TRUE));
5979         
5980                         } else {
5981                         
5982                                 PropertyDataMap->erase(PropertyName);
5983                                 PropertyDataMap->insert(std::make_pair(PropertyName, PropertyValue));
5984                                 PropertyLockMap->erase(PropertyName);
5985                                 PropertyLockMap->insert(std::make_pair(PropertyName, TRUE));
5986                         
5987                         }
5988                 
5989                 }
5990                 
5991                 wxSPropertyDataOut->Append(wxT("data:"));
5992                 wxSPropertyDataOut->Append(wxSMIMEType);
5993                 wxSPropertyDataOut->Append(wxT(";"));
5994                 wxSPropertyDataOut->Append(wxSEncType);
5995                 wxSPropertyDataOut->Append(wxT(","));
5996                 wxSPropertyDataOut->Append(*wxSPropertySeg2Ptr);
5997         
5998         }
5999         
6000         // SOUND
6001         
6002         if (wxSProperty == wxT("SOUND")){
6003                 
6004                 int intPropertyLen;
6005                 
6006                 if (ProcessItemData == TRUE){
6007         
6008                         intPropertyLen = wxSPropertySeg1Chopped.Len();          
6009                 
6010                 } else {
6011                 
6012                         intPropertyLen = wxSPropertySeg1Ptr->Len();
6013                 
6014                 }
6015                 
6016                 std::map<int, int> SplitPoints;
6017                 std::map<int, int> SplitLength;
6018                 std::map<int, int>::iterator SLiter;                    
6019                 wxString PropertyData;
6020                 wxString PropertyName;
6021                 wxString PropertyValue;
6022                 wxString PropertyTokens;
6023                 wxString PropertyXOmitYear;
6024                 bool AfterFirstToken = FALSE;
6025                 bool FirstToken = TRUE;         
6026                 int intSplitsFound = 0;
6027                 int intSplitSize = 0;
6028                 int intPrevValue = 7;
6029                 int intPref = 0;
6030                 int intType = 0;
6031                 int intSplitSeek = 0;
6033                 
6034                 *wxSPropertyDataNameOut = wxT("SOUND");
6035                 *VCardV3Value = TRUE;
6036                 
6037                 if (ProcessItemData == TRUE){
6038                 
6039                         SplitValues(&wxSPropertySeg1Chopped, &SplitPoints, &SplitLength, intPrevValue);
6040                         
6041                 } else {
6042                         
6043                         SplitValues(wxSPropertySeg1Ptr, &SplitPoints, &SplitLength, intPrevValue);
6044                         
6045                 }
6046                 
6047                 wxString wxSMIMEType;
6048                 wxString wxSEncType;
6049                 
6050                 for (std::map<int, int>::iterator intiter = SplitPoints.begin(); 
6051                 intiter != SplitPoints.end(); ++intiter){
6052                 
6053                         SLiter = SplitLength.find(intiter->first);
6054                 
6055                         if (ProcessItemData == TRUE){
6056                 
6057                                 if (FirstToken == TRUE){
6058                         
6059                                         PropertyData = wxSPropertySeg1Chopped.Mid((intPrevValue - 1), (SLiter->second));
6060                                         FirstToken = FALSE;
6061                         
6062                                 } else {
6063                                 
6064                                         PropertyData = wxSPropertySeg1Chopped.Mid((intPrevValue), (SLiter->second));
6065                                 
6066                                 }
6067                         
6068                         } else {                        
6069                                 
6070                                 if (FirstToken == TRUE){
6071                         
6072                                         PropertyData = wxSPropertySeg1Ptr->Mid((intPrevValue - 1), (SLiter->second));
6073                                         FirstToken = FALSE;
6074                         
6075                                 } else {
6076                                 
6077                                         PropertyData = wxSPropertySeg1Ptr->Mid((intPrevValue), (SLiter->second));
6078                                 
6079                                 }
6080                         
6081                         }
6082                         
6083                         wxStringTokenizer PropertyElement (PropertyData, wxT("="));
6084                         PropertyName = PropertyElement.GetNextToken();                          
6085                         PropertyValue = PropertyElement.GetNextToken();
6086                         
6087                         //ProcessCaptureStrings(&PropertyValue);
6088                         
6089                         if (PropertyName == wxT("ENCODING") && PropertyValue == wxT("b")){
6090                                 wxSEncType = wxT("base64");
6091                                 continue;
6092                         }
6093                         
6094                         if ((PropertyName == wxT("TYPE") || PropertyName == wxT("type"))){
6095                                 wxSMIMEType = PropertyValue;
6096                                 continue;
6097                         }
6098                         
6099                         intPrevValue = intiter->second;
6100                         
6101                         // Process properties.
6102                         
6103                         if (PropertyName.IsEmpty()){
6104                         
6105                                 continue;
6106                         
6107                         }
6108                         
6109                         if (PropertyDataMap->find(PropertyName) == PropertyDataMap->end()){
6111                                 PropertyDataMap->insert(std::make_pair(PropertyName, PropertyValue));
6112                                 PropertyLockMap->insert(std::make_pair(PropertyName, TRUE));
6113         
6114                         } else {
6115                         
6116                                 PropertyDataMap->erase(PropertyName);
6117                                 PropertyDataMap->insert(std::make_pair(PropertyName, PropertyValue));
6118                                 PropertyLockMap->erase(PropertyName);
6119                                 PropertyLockMap->insert(std::make_pair(PropertyName, TRUE));
6120                         
6121                         }
6122                 
6123                 }
6124                 
6125                 wxSPropertyDataOut->Append(wxT("data:"));
6126                 wxSPropertyDataOut->Append(wxSMIMEType);
6127                 wxSPropertyDataOut->Append(wxT(";"));
6128                 wxSPropertyDataOut->Append(wxSEncType);
6129                 wxSPropertyDataOut->Append(wxT(","));
6130                 wxSPropertyDataOut->Append(*wxSPropertySeg2Ptr);
6131         
6132         }
6133         
6134         // Look for backward compatability vCard 4.0 properties.
6135         
6136         // X-VCARD4-FN
6137         
6138         if (wxSProperty == wxT("X-VCARD4-FN")){
6139         
6140                 int intPropertyLen;
6141                 
6142                 if (ProcessItemData == TRUE){
6143         
6144                         intPropertyLen = wxSPropertySeg1Chopped.Len();          
6145                 
6146                 } else {
6147                 
6148                         intPropertyLen = wxSPropertySeg1Ptr->Len();
6149                                 *wxSPropertyDataNameOut = wxT("FN");
6150                 
6151                 }
6152                 
6153                 std::map<int, int> SplitPoints;
6154                 std::map<int, int> SplitLength;
6155                 std::map<int, int>::iterator SLiter;
6156                 std::map<wxString, bool>::iterator BIter;;                      
6157                 wxString PropertyData;
6158                 wxString PropertyName;
6159                 wxString PropertyValue;
6160                 wxString PropertyTokens;
6161                 bool AfterFirstToken = FALSE;
6162                 bool FirstToken = TRUE;                 
6163                 int intSplitsFound = 0;
6164                 int intSplitSize = 0;
6165                 int intPrevValue = 13;
6166                 int intPref = 0;
6167                 int intType = 0;
6168                 int intSplitSeek = 0;
6171                 if (ProcessItemData == TRUE){
6172                 
6173                         SplitValues(&wxSPropertySeg1Chopped, &SplitPoints, &SplitLength, intPrevValue);
6174                         
6175                 } else {
6176                         
6177                         SplitValues(wxSPropertySeg1Ptr, &SplitPoints, &SplitLength, intPrevValue);
6178                         
6179                 }
6180                 
6181                 for (std::map<int, int>::iterator intiter = SplitPoints.begin(); 
6182                 intiter != SplitPoints.end(); ++intiter){
6183                 
6184                         SLiter = SplitLength.find(intiter->first);
6185                 
6186                         if (ProcessItemData == TRUE){
6188                                 if (FirstToken == TRUE){
6189                 
6190                                         PropertyData = wxSPropertySeg1Chopped.Mid((intPrevValue - 1), (SLiter->second));
6191                                         FirstToken = FALSE;
6192                                 
6193                                 } else {
6194                                 
6195                                         PropertyData = wxSPropertySeg1Chopped.Mid((intPrevValue), (SLiter->second));
6196                                 
6197                                 }
6198                         
6199                         } else {
6200                         
6201                                 if (FirstToken == TRUE){
6202                         
6203                                         PropertyData = wxSPropertySeg1Ptr->Mid((intPrevValue - 1), (SLiter->second));
6204                                         FirstToken = FALSE;
6205                                                                 
6206                                 } else {
6207                                 
6208                                         PropertyData = wxSPropertySeg1Ptr->Mid((intPrevValue), (SLiter->second));
6209                                         
6210                                 }
6211                         
6212                         }
6213                         
6214                         wxStringTokenizer PropertyElement (PropertyData, wxT("="));
6215                         PropertyName = PropertyElement.GetNextToken();                          
6216                         PropertyValue = PropertyElement.GetNextToken();
6217                         
6218                         //ProcessCaptureStrings(&PropertyValue);
6219                         
6220                         intPrevValue = intiter->second;
6221                         
6222                         // Process properties.
6223                         
6224                         // Check if there is a lock on the property value. If there is a lock then
6225                         // the property value cannot be changed.
6226                         
6227                         if (PropertyName.IsEmpty()){
6228                         
6229                                 continue;
6230                         
6231                         }
6232                         
6233                         if (PropertyLockMap->find(PropertyName) == PropertyLockMap->end()){
6234                         
6235                                 if (PropertyDataMap->find(PropertyName) == PropertyDataMap->end()){
6236                         
6237                                         PropertyDataMap->insert(std::make_pair(PropertyName, PropertyValue));
6238                         
6239                                 } else {
6240                         
6241                                         PropertyDataMap->erase(PropertyName);
6242                                         PropertyDataMap->insert(std::make_pair(PropertyName, PropertyValue));
6243                         
6244                                 }
6245                                 
6246                         }
6247                         
6248                         //wxSPropertyPropValuesOut->Append(wxT(";"));
6249                         //wxSPropertyPropValuesOut->Append(PropertyName + wxT("=") + PropertyValue);
6250                 
6251                 }
6252                 
6253                 wxSPropertyXVCard4Value->Append(*wxSPropertySeg2Ptr);
6254                 *XVCardV4Value = TRUE;
6255                                 
6256         }
6257         
6258         // X-VCARD4-N
6259         
6260         if (wxSProperty == wxT("X-VCARD4-N")){
6261         
6262                 int intPropertyLen;
6263                 
6264                 if (ProcessItemData == TRUE){
6265         
6266                         intPropertyLen = wxSPropertySeg1Chopped.Len();          
6267                 
6268                 } else {
6269                 
6270                         intPropertyLen = wxSPropertySeg1Ptr->Len();
6271                 
6272                 }
6273                 
6274                 std::map<int, int> SplitPoints;
6275                 std::map<int, int> SplitLength;
6276                 std::map<int, int>::iterator SLiter;
6277                 std::map<wxString, bool>::iterator BIter;;                      
6278                 wxString PropertyData;
6279                 wxString PropertyName;
6280                 wxString PropertyValue;
6281                 wxString PropertyTokens;
6282                 bool AfterFirstToken = FALSE;
6283                 bool FirstToken = TRUE;                 
6284                 int intSplitsFound = 0;
6285                 int intSplitSize = 0;
6286                 int intPrevValue = 12;
6287                 int intPref = 0;
6288                 int intType = 0;
6289                 int intSplitSeek = 0;
6292                 if (ProcessItemData == TRUE){
6293                 
6294                         SplitValues(&wxSPropertySeg1Chopped, &SplitPoints, &SplitLength, intPrevValue);
6295                         
6296                 } else {
6297                         
6298                         SplitValues(wxSPropertySeg1Ptr, &SplitPoints, &SplitLength, intPrevValue);
6299                         *wxSPropertyDataNameOut = wxT("N");
6300                         
6301                 }
6302                 
6303                 for (std::map<int, int>::iterator intiter = SplitPoints.begin(); 
6304                 intiter != SplitPoints.end(); ++intiter){
6305                 
6306                         SLiter = SplitLength.find(intiter->first);
6307                 
6308                         if (ProcessItemData == TRUE){
6310                                 if (FirstToken == TRUE){
6311                 
6312                                         PropertyData = wxSPropertySeg1Chopped.Mid((intPrevValue - 1), (SLiter->second));
6313                                         FirstToken = FALSE;
6314                                 
6315                                 } else {
6316                                 
6317                                         PropertyData = wxSPropertySeg1Chopped.Mid((intPrevValue), (SLiter->second));
6318                                 
6319                                 }
6320                         
6321                         } else {
6322                         
6323                                 if (FirstToken == TRUE){
6324                         
6325                                         PropertyData = wxSPropertySeg1Ptr->Mid((intPrevValue - 1), (SLiter->second));
6326                                         FirstToken = FALSE;
6327                                                                 
6328                                 } else {
6329                                 
6330                                         PropertyData = wxSPropertySeg1Ptr->Mid((intPrevValue), (SLiter->second));
6331                                         
6332                                 }
6333                         
6334                         }
6335                         
6336                         wxStringTokenizer PropertyElement (PropertyData, wxT("="));
6337                         PropertyName = PropertyElement.GetNextToken();                          
6338                         PropertyValue = PropertyElement.GetNextToken();
6339                         
6340                         //ProcessCaptureStrings(&PropertyValue);
6341                         
6342                         intPrevValue = intiter->second;
6343                         
6344                         // Process properties.
6345                         
6346                         // Check if there is a lock on the property value. If there is a lock then
6347                         // the property value cannot be changed.
6348                         
6349                         if (PropertyName.IsEmpty()){
6350                         
6351                                 continue;
6352                         
6353                         }
6354                         
6355                         if (PropertyLockMap->find(PropertyName) == PropertyLockMap->end()){
6356                         
6357                                 if (PropertyDataMap->find(PropertyName) == PropertyDataMap->end()){
6358                         
6359                                         PropertyDataMap->insert(std::make_pair(PropertyName, PropertyValue));
6360                         
6361                                 } else {
6362                         
6363                                         PropertyDataMap->erase(PropertyName);
6364                                         PropertyDataMap->insert(std::make_pair(PropertyName, PropertyValue));
6365                         
6366                                 }
6367                                 
6368                         }
6369                         
6370                         //wxSPropertyPropValuesOut->Append(wxT(";"));
6371                         //wxSPropertyPropValuesOut->Append(PropertyName + wxT("=") + PropertyValue);
6372                 
6373                 }
6374                 
6375                 wxSPropertyXVCard4Value->Append(*wxSPropertySeg2Ptr);
6376                 *XVCardV4Value = TRUE;
6377                                 
6378         }
6379         
6380         // X-VCARD4-NICKNAME
6381         
6382         if (wxSProperty == wxT("X-VCARD4-NICKNAME")){
6383         
6384                 int intPropertyLen;
6385                 
6386                 if (ProcessItemData == TRUE){
6387         
6388                         intPropertyLen = wxSPropertySeg1Chopped.Len();          
6389                 
6390                 } else {
6391                 
6392                         intPropertyLen = wxSPropertySeg1Ptr->Len();
6393                 
6394                 }
6395                 
6396                 std::map<int, int> SplitPoints;
6397                 std::map<int, int> SplitLength;
6398                 std::map<int, int>::iterator SLiter;
6399                 std::map<wxString, bool>::iterator BIter;;                      
6400                 wxString PropertyData;
6401                 wxString PropertyName;
6402                 wxString PropertyValue;
6403                 wxString PropertyTokens;
6404                 bool AfterFirstToken = FALSE;
6405                 bool FirstToken = TRUE;                 
6406                 int intSplitsFound = 0;
6407                 int intSplitSize = 0;
6408                 int intPrevValue = 19;
6409                 int intPref = 0;
6410                 int intType = 0;
6411                 int intSplitSeek = 0;
6414                 if (ProcessItemData == TRUE){
6415                 
6416                         SplitValues(&wxSPropertySeg1Chopped, &SplitPoints, &SplitLength, intPrevValue);
6417                         
6418                 } else {
6419                         
6420                         SplitValues(wxSPropertySeg1Ptr, &SplitPoints, &SplitLength, intPrevValue);
6421                         *wxSPropertyDataNameOut = wxT("NICKNAME");
6422                         
6423                 }
6424                 
6425                 for (std::map<int, int>::iterator intiter = SplitPoints.begin(); 
6426                 intiter != SplitPoints.end(); ++intiter){
6427                 
6428                         SLiter = SplitLength.find(intiter->first);
6429                 
6430                         if (ProcessItemData == TRUE){
6432                                 if (FirstToken == TRUE){
6433                 
6434                                         PropertyData = wxSPropertySeg1Chopped.Mid((intPrevValue - 1), (SLiter->second));
6435                                         FirstToken = FALSE;
6436                                 
6437                                 } else {
6438                                 
6439                                         PropertyData = wxSPropertySeg1Chopped.Mid((intPrevValue), (SLiter->second));
6440                                 
6441                                 }
6442                         
6443                         } else {
6444                         
6445                                 if (FirstToken == TRUE){
6446                         
6447                                         PropertyData = wxSPropertySeg1Ptr->Mid((intPrevValue - 1), (SLiter->second));
6448                                         FirstToken = FALSE;
6449                                                                 
6450                                 } else {
6451                                 
6452                                         PropertyData = wxSPropertySeg1Ptr->Mid((intPrevValue), (SLiter->second));
6453                                         
6454                                 }
6455                         
6456                         }
6457                         
6458                         wxStringTokenizer PropertyElement (PropertyData, wxT("="));
6459                         PropertyName = PropertyElement.GetNextToken();                          
6460                         PropertyValue = PropertyElement.GetNextToken();
6461                         
6462                         //ProcessCaptureStrings(&PropertyValue);
6463                         
6464                         intPrevValue = intiter->second;
6465                         
6466                         // Process properties.
6467                         
6468                         // Check if there is a lock on the property value. If there is a lock then
6469                         // the property value cannot be changed.
6470                         
6471                         if (PropertyName.IsEmpty()){
6472                         
6473                                 continue;
6474                         
6475                         }
6476                         
6477                         if (PropertyLockMap->find(PropertyName) == PropertyLockMap->end()){
6478                         
6479                                 if (PropertyDataMap->find(PropertyName) == PropertyDataMap->end()){
6480                         
6481                                         PropertyDataMap->insert(std::make_pair(PropertyName, PropertyValue));
6482                         
6483                                 } else {
6484                         
6485                                         PropertyDataMap->erase(PropertyName);
6486                                         PropertyDataMap->insert(std::make_pair(PropertyName, PropertyValue));
6487                         
6488                                 }
6489                                 
6490                         }
6491                         
6492                         //wxSPropertyPropValuesOut->Append(wxT(";"));
6493                         //wxSPropertyPropValuesOut->Append(PropertyName + wxT("=") + PropertyValue);
6494                 
6495                 }
6496                 
6497                 wxSPropertyXVCard4Value->Append(*wxSPropertySeg2Ptr);
6498                 *XVCardV4Value = TRUE;
6499                                 
6500         }
6501         
6502         // X-VCARD4-GENDER
6503         
6504         if (wxSProperty == wxT("X-VCARD4-GENDER")){
6505         
6506                 int intPropertyLen;
6507                 
6508                 if (ProcessItemData == TRUE){
6509         
6510                         intPropertyLen = wxSPropertySeg1Chopped.Len();          
6511                 
6512                 } else {
6513                 
6514                         intPropertyLen = wxSPropertySeg1Ptr->Len();
6515                 
6516                 }
6517                 
6518                 std::map<int, int> SplitPoints;
6519                 std::map<int, int> SplitLength;
6520                 std::map<int, int>::iterator SLiter;
6521                 std::map<wxString, bool>::iterator BIter;;                      
6522                 wxString PropertyData;
6523                 wxString PropertyName;
6524                 wxString PropertyValue;
6525                 wxString PropertyTokens;
6526                 bool AfterFirstToken = FALSE;
6527                 bool FirstToken = TRUE;                 
6528                 int intSplitsFound = 0;
6529                 int intSplitSize = 0;
6530                 int intPrevValue = 17;
6531                 int intPref = 0;
6532                 int intType = 0;
6533                 int intSplitSeek = 0;
6536                 if (ProcessItemData == TRUE){
6537                 
6538                         SplitValues(&wxSPropertySeg1Chopped, &SplitPoints, &SplitLength, intPrevValue);
6539                         
6540                 } else {
6541                         
6542                         SplitValues(wxSPropertySeg1Ptr, &SplitPoints, &SplitLength, intPrevValue);
6543                         *wxSPropertyDataNameOut = wxT("GENDER");
6544                         
6545                 }
6546                 
6547                 for (std::map<int, int>::iterator intiter = SplitPoints.begin(); 
6548                 intiter != SplitPoints.end(); ++intiter){
6549                 
6550                         SLiter = SplitLength.find(intiter->first);
6551                 
6552                         if (ProcessItemData == TRUE){
6554                                 if (FirstToken == TRUE){
6555                 
6556                                         PropertyData = wxSPropertySeg1Chopped.Mid((intPrevValue - 1), (SLiter->second));
6557                                         FirstToken = FALSE;
6558                                 
6559                                 } else {
6560                                 
6561                                         PropertyData = wxSPropertySeg1Chopped.Mid((intPrevValue), (SLiter->second));
6562                                 
6563                                 }
6564                         
6565                         } else {
6566                         
6567                                 if (FirstToken == TRUE){
6568                         
6569                                         PropertyData = wxSPropertySeg1Ptr->Mid((intPrevValue - 1), (SLiter->second));
6570                                         FirstToken = FALSE;
6571                                                                 
6572                                 } else {
6573                                 
6574                                         PropertyData = wxSPropertySeg1Ptr->Mid((intPrevValue), (SLiter->second));
6575                                         
6576                                 }
6577                         
6578                         }
6579                         
6580                         wxStringTokenizer PropertyElement (PropertyData, wxT("="));
6581                         PropertyName = PropertyElement.GetNextToken();                          
6582                         PropertyValue = PropertyElement.GetNextToken();
6583                         
6584                         //ProcessCaptureStrings(&PropertyValue);
6585                         
6586                         intPrevValue = intiter->second;
6587                         
6588                         // Process properties.
6589                         
6590                         // Check if there is a lock on the property value. If there is a lock then
6591                         // the property value cannot be changed.
6592                         
6593                         if (PropertyName.IsEmpty()){
6594                         
6595                                 continue;
6596                         
6597                         }
6598                         
6599                         if (PropertyLockMap->find(PropertyName) == PropertyLockMap->end()){
6600                         
6601                                 if (PropertyDataMap->find(PropertyName) == PropertyDataMap->end()){
6602                         
6603                                         PropertyDataMap->insert(std::make_pair(PropertyName, PropertyValue));
6604                         
6605                                 } else {
6606                         
6607                                         PropertyDataMap->erase(PropertyName);
6608                                         PropertyDataMap->insert(std::make_pair(PropertyName, PropertyValue));
6609                         
6610                                 }
6611                                 
6612                         }
6613                         
6614                         //wxSPropertyPropValuesOut->Append(wxT(";"));
6615                         //wxSPropertyPropValuesOut->Append(PropertyName + wxT("=") + PropertyValue);
6616                 
6617                 }
6618                 
6619                 wxSPropertyXVCard4Value->Append(*wxSPropertySeg2Ptr);
6620                 *XVCardV4Value = TRUE;
6621                                 
6622         }
6623         
6624         // X-VCARD4-BDAY
6625         
6626         if (wxSProperty == wxT("X-VCARD4-BDAY")){
6627         
6628                 int intPropertyLen;
6629                 
6630                 if (ProcessItemData == TRUE){
6631         
6632                         intPropertyLen = wxSPropertySeg1Chopped.Len();          
6633                 
6634                 } else {
6635                 
6636                         intPropertyLen = wxSPropertySeg1Ptr->Len();
6637                 
6638                 }
6639                 
6640                 std::map<int, int> SplitPoints;
6641                 std::map<int, int> SplitLength;
6642                 std::map<int, int>::iterator SLiter;
6643                 std::map<wxString, bool>::iterator BIter;;                      
6644                 wxString PropertyData;
6645                 wxString PropertyName;
6646                 wxString PropertyValue;
6647                 wxString PropertyTokens;
6648                 bool AfterFirstToken = FALSE;
6649                 bool FirstToken = TRUE;                 
6650                 int intSplitsFound = 0;
6651                 int intSplitSize = 0;
6652                 int intPrevValue = 15;
6653                 int intPref = 0;
6654                 int intType = 0;
6655                 int intSplitSeek = 0;
6658                 if (ProcessItemData == TRUE){
6659                 
6660                         SplitValues(&wxSPropertySeg1Chopped, &SplitPoints, &SplitLength, intPrevValue);
6661                         
6662                 } else {
6663                         
6664                         SplitValues(wxSPropertySeg1Ptr, &SplitPoints, &SplitLength, intPrevValue);
6665                         *wxSPropertyDataNameOut = wxT("BDAY");
6666                         
6667                 }
6668                 
6669                 for (std::map<int, int>::iterator intiter = SplitPoints.begin(); 
6670                 intiter != SplitPoints.end(); ++intiter){
6671                 
6672                         SLiter = SplitLength.find(intiter->first);
6673                 
6674                         if (ProcessItemData == TRUE){
6676                                 if (FirstToken == TRUE){
6677                 
6678                                         PropertyData = wxSPropertySeg1Chopped.Mid((intPrevValue - 1), (SLiter->second));
6679                                         FirstToken = FALSE;
6680                                 
6681                                 } else {
6682                                 
6683                                         PropertyData = wxSPropertySeg1Chopped.Mid((intPrevValue), (SLiter->second));
6684                                 
6685                                 }
6686                         
6687                         } else {
6688                         
6689                                 if (FirstToken == TRUE){
6690                         
6691                                         PropertyData = wxSPropertySeg1Ptr->Mid((intPrevValue - 1), (SLiter->second));
6692                                         FirstToken = FALSE;
6693                                                                 
6694                                 } else {
6695                                 
6696                                         PropertyData = wxSPropertySeg1Ptr->Mid((intPrevValue), (SLiter->second));
6697                                         
6698                                 }
6699                         
6700                         }
6701                         
6702                         wxStringTokenizer PropertyElement (PropertyData, wxT("="));
6703                         PropertyName = PropertyElement.GetNextToken();                          
6704                         PropertyValue = PropertyElement.GetNextToken();
6705                         
6706                         //ProcessCaptureStrings(&PropertyValue);
6707                         
6708                         intPrevValue = intiter->second;
6709                         
6710                         // Process properties.
6711                         
6712                         // Check if there is a lock on the property value. If there is a lock then
6713                         // the property value cannot be changed.
6714                         
6715                         if (PropertyName.IsEmpty()){
6716                         
6717                                 continue;
6718                         
6719                         }
6720                         
6721                         if (PropertyLockMap->find(PropertyName) == PropertyLockMap->end()){
6722                         
6723                                 if (PropertyDataMap->find(PropertyName) == PropertyDataMap->end()){
6724                         
6725                                         PropertyDataMap->insert(std::make_pair(PropertyName, PropertyValue));
6726                         
6727                                 } else {
6728                         
6729                                         PropertyDataMap->erase(PropertyName);
6730                                         PropertyDataMap->insert(std::make_pair(PropertyName, PropertyValue));
6731                         
6732                                 }
6733                                 
6734                         }
6735                         
6736                         //wxSPropertyPropValuesOut->Append(wxT(";"));
6737                         //wxSPropertyPropValuesOut->Append(PropertyName + wxT("=") + PropertyValue);
6738                 
6739                 }
6740                 
6741                 wxSPropertyXVCard4Value->Append(*wxSPropertySeg2Ptr);
6742                 *XVCardV4Value = TRUE;
6743                                 
6744         }
6746         // X-VCARD4-ANNIVERSARY
6747         
6748         if (wxSProperty == wxT("X-VCARD4-ANNIVERSARY")){
6749         
6750                 int intPropertyLen;
6751                 
6752                 if (ProcessItemData == TRUE){
6753         
6754                         intPropertyLen = wxSPropertySeg1Chopped.Len();          
6755                 
6756                 } else {
6757                 
6758                         intPropertyLen = wxSPropertySeg1Ptr->Len();
6759                 
6760                 }
6761                 
6762                 std::map<int, int> SplitPoints;
6763                 std::map<int, int> SplitLength;
6764                 std::map<int, int>::iterator SLiter;
6765                 std::map<wxString, bool>::iterator BIter;;                      
6766                 wxString PropertyData;
6767                 wxString PropertyName;
6768                 wxString PropertyValue;
6769                 wxString PropertyTokens;
6770                 bool AfterFirstToken = FALSE;
6771                 bool FirstToken = TRUE;                 
6772                 int intSplitsFound = 0;
6773                 int intSplitSize = 0;
6774                 int intPrevValue = 22;
6775                 int intPref = 0;
6776                 int intType = 0;
6777                 int intSplitSeek = 0;
6780                 if (ProcessItemData == TRUE){
6781                 
6782                         SplitValues(&wxSPropertySeg1Chopped, &SplitPoints, &SplitLength, intPrevValue);
6783                         
6784                 } else {
6785                         
6786                         SplitValues(wxSPropertySeg1Ptr, &SplitPoints, &SplitLength, intPrevValue);
6787                         *wxSPropertyDataNameOut = wxT("ANNIVERSARY");
6788                         
6789                 }
6790                 
6791                 for (std::map<int, int>::iterator intiter = SplitPoints.begin(); 
6792                 intiter != SplitPoints.end(); ++intiter){
6793                 
6794                         SLiter = SplitLength.find(intiter->first);
6795                 
6796                         if (ProcessItemData == TRUE){
6798                                 if (FirstToken == TRUE){
6799                 
6800                                         PropertyData = wxSPropertySeg1Chopped.Mid((intPrevValue - 1), (SLiter->second));
6801                                         FirstToken = FALSE;
6802                                 
6803                                 } else {
6804                                 
6805                                         PropertyData = wxSPropertySeg1Chopped.Mid((intPrevValue), (SLiter->second));
6806                                 
6807                                 }
6808                         
6809                         } else {
6810                         
6811                                 if (FirstToken == TRUE){
6812                         
6813                                         PropertyData = wxSPropertySeg1Ptr->Mid((intPrevValue - 1), (SLiter->second));
6814                                         FirstToken = FALSE;
6815                                                                 
6816                                 } else {
6817                                 
6818                                         PropertyData = wxSPropertySeg1Ptr->Mid((intPrevValue), (SLiter->second));
6819                                         
6820                                 }
6821                         
6822                         }
6823                         
6824                         wxStringTokenizer PropertyElement (PropertyData, wxT("="));
6825                         PropertyName = PropertyElement.GetNextToken();                          
6826                         PropertyValue = PropertyElement.GetNextToken();
6827                         
6828                         //ProcessCaptureStrings(&PropertyValue);
6829                         
6830                         intPrevValue = intiter->second;
6831                         
6832                         // Process properties.
6833                         
6834                         // Check if there is a lock on the property value. If there is a lock then
6835                         // the property value cannot be changed.
6836                         
6837                         if (PropertyName.IsEmpty()){
6838                         
6839                                 continue;
6840                         
6841                         }
6842                         
6843                         if (PropertyLockMap->find(PropertyName) == PropertyLockMap->end()){
6844                         
6845                                 if (PropertyDataMap->find(PropertyName) == PropertyDataMap->end()){
6846                         
6847                                         PropertyDataMap->insert(std::make_pair(PropertyName, PropertyValue));
6848                         
6849                                 } else {
6850                         
6851                                         PropertyDataMap->erase(PropertyName);
6852                                         PropertyDataMap->insert(std::make_pair(PropertyName, PropertyValue));
6853                         
6854                                 }
6855                                 
6856                         }
6857                         
6858                         //wxSPropertyPropValuesOut->Append(wxT(";"));
6859                         //wxSPropertyPropValuesOut->Append(PropertyName + wxT("=") + PropertyValue);
6860                 
6861                 }
6862                 
6863                 wxSPropertyXVCard4Value->Append(*wxSPropertySeg2Ptr);
6864                 *XVCardV4Value = TRUE;
6865                                 
6866         }
6868         // X-VCARD4-TZ
6869         
6870         if (wxSProperty == wxT("X-VCARD4-TZ")){
6871         
6872                 int intPropertyLen;
6873                 
6874                 if (ProcessItemData == TRUE){
6875         
6876                         intPropertyLen = wxSPropertySeg1Chopped.Len();          
6877                 
6878                 } else {
6879                 
6880                         intPropertyLen = wxSPropertySeg1Ptr->Len();
6881                 
6882                 }
6883                 
6884                 std::map<int, int> SplitPoints;
6885                 std::map<int, int> SplitLength;
6886                 std::map<int, int>::iterator SLiter;
6887                 std::map<wxString, bool>::iterator BIter;;                      
6888                 wxString PropertyData;
6889                 wxString PropertyName;
6890                 wxString PropertyValue;
6891                 wxString PropertyTokens;
6892                 bool AfterFirstToken = FALSE;
6893                 bool FirstToken = TRUE;                 
6894                 int intSplitsFound = 0;
6895                 int intSplitSize = 0;
6896                 int intPrevValue = 13;
6897                 int intPref = 0;
6898                 int intType = 0;
6899                 int intSplitSeek = 0;
6902                 if (ProcessItemData == TRUE){
6903                 
6904                         SplitValues(&wxSPropertySeg1Chopped, &SplitPoints, &SplitLength, intPrevValue);
6905                         
6906                 } else {
6907                         
6908                         SplitValues(wxSPropertySeg1Ptr, &SplitPoints, &SplitLength, intPrevValue);
6909                         *wxSPropertyDataNameOut = wxT("TZ");
6910                         
6911                 }
6912                 
6913                 for (std::map<int, int>::iterator intiter = SplitPoints.begin(); 
6914                 intiter != SplitPoints.end(); ++intiter){
6915                 
6916                         SLiter = SplitLength.find(intiter->first);
6917                 
6918                         if (ProcessItemData == TRUE){
6920                                 if (FirstToken == TRUE){
6921                 
6922                                         PropertyData = wxSPropertySeg1Chopped.Mid((intPrevValue - 1), (SLiter->second));
6923                                         FirstToken = FALSE;
6924                                 
6925                                 } else {
6926                                 
6927                                         PropertyData = wxSPropertySeg1Chopped.Mid((intPrevValue), (SLiter->second));
6928                                 
6929                                 }
6930                         
6931                         } else {
6932                         
6933                                 if (FirstToken == TRUE){
6934                         
6935                                         PropertyData = wxSPropertySeg1Ptr->Mid((intPrevValue - 1), (SLiter->second));
6936                                         FirstToken = FALSE;
6937                                                                 
6938                                 } else {
6939                                 
6940                                         PropertyData = wxSPropertySeg1Ptr->Mid((intPrevValue), (SLiter->second));
6941                                         
6942                                 }
6943                         
6944                         }
6945                         
6946                         wxStringTokenizer PropertyElement (PropertyData, wxT("="));
6947                         PropertyName = PropertyElement.GetNextToken();                          
6948                         PropertyValue = PropertyElement.GetNextToken();
6949                         
6950                         //ProcessCaptureStrings(&PropertyValue);
6951                         
6952                         intPrevValue = intiter->second;
6953                         
6954                         // Process properties.
6955                         
6956                         // Check if there is a lock on the property value. If there is a lock then
6957                         // the property value cannot be changed.
6958                         
6959                         if (PropertyName.IsEmpty()){
6960                         
6961                                 continue;
6962                         
6963                         }
6964                         
6965                         if (PropertyLockMap->find(PropertyName) == PropertyLockMap->end()){
6966                         
6967                                 if (PropertyDataMap->find(PropertyName) == PropertyDataMap->end()){
6968                         
6969                                         PropertyDataMap->insert(std::make_pair(PropertyName, PropertyValue));
6970                         
6971                                 } else {
6972                         
6973                                         PropertyDataMap->erase(PropertyName);
6974                                         PropertyDataMap->insert(std::make_pair(PropertyName, PropertyValue));
6975                         
6976                                 }
6977                                 
6978                         }
6979                         
6980                         //wxSPropertyPropValuesOut->Append(wxT(";"));
6981                         //wxSPropertyPropValuesOut->Append(PropertyName + wxT("=") + PropertyValue);
6982                 
6983                 }
6984                 
6985                 wxSPropertyXVCard4Value->Append(*wxSPropertySeg2Ptr);
6986                 *XVCardV4Value = TRUE;
6987                                 
6988         }
6989         
6990         // X-VCARD4-ADR
6991         
6992         if (wxSProperty == wxT("X-VCARD4-ADR")){
6993         
6994                 int intPropertyLen;
6995                 
6996                 if (ProcessItemData == TRUE){
6997         
6998                         intPropertyLen = wxSPropertySeg1Chopped.Len();          
6999                 
7000                 } else {
7001                 
7002                         intPropertyLen = wxSPropertySeg1Ptr->Len();
7003                 
7004                 }
7005                 
7006                 std::map<int, int> SplitPoints;
7007                 std::map<int, int> SplitLength;
7008                 std::map<int, int>::iterator SLiter;
7009                 std::map<wxString, bool>::iterator BIter;;                      
7010                 wxString PropertyData;
7011                 wxString PropertyName;
7012                 wxString PropertyValue;
7013                 wxString PropertyTokens;
7014                 bool AfterFirstToken = FALSE;
7015                 bool FirstToken = TRUE;                 
7016                 int intSplitsFound = 0;
7017                 int intSplitSize = 0;
7018                 int intPrevValue = 14;
7019                 int intPref = 0;
7020                 int intType = 0;
7021                 int intSplitSeek = 0;
7024                 if (ProcessItemData == TRUE){
7025                 
7026                         SplitValues(&wxSPropertySeg1Chopped, &SplitPoints, &SplitLength, intPrevValue);
7027                         
7028                 } else {
7029                         
7030                         SplitValues(wxSPropertySeg1Ptr, &SplitPoints, &SplitLength, intPrevValue);
7031                         *wxSPropertyDataNameOut = wxT("ADR");
7032                         
7033                 }
7034                 
7035                 for (std::map<int, int>::iterator intiter = SplitPoints.begin(); 
7036                 intiter != SplitPoints.end(); ++intiter){
7037                 
7038                         SLiter = SplitLength.find(intiter->first);
7039                 
7040                         if (ProcessItemData == TRUE){
7042                                 if (FirstToken == TRUE){
7043                 
7044                                         PropertyData = wxSPropertySeg1Chopped.Mid((intPrevValue - 1), (SLiter->second));
7045                                         FirstToken = FALSE;
7046                                 
7047                                 } else {
7048                                 
7049                                         PropertyData = wxSPropertySeg1Chopped.Mid((intPrevValue), (SLiter->second));
7050                                 
7051                                 }
7052                         
7053                         } else {
7054                         
7055                                 if (FirstToken == TRUE){
7056                         
7057                                         PropertyData = wxSPropertySeg1Ptr->Mid((intPrevValue - 1), (SLiter->second));
7058                                         FirstToken = FALSE;
7059                                                                 
7060                                 } else {
7061                                 
7062                                         PropertyData = wxSPropertySeg1Ptr->Mid((intPrevValue), (SLiter->second));
7063                                         
7064                                 }
7065                         
7066                         }
7067                         
7068                         wxStringTokenizer PropertyElement (PropertyData, wxT("="));
7069                         PropertyName = PropertyElement.GetNextToken();                          
7070                         PropertyValue = PropertyElement.GetNextToken();
7071                         
7072                         //ProcessCaptureStrings(&PropertyValue);
7073                         
7074                         intPrevValue = intiter->second;
7075                         
7076                         // Process properties.
7077                         
7078                         // Check if there is a lock on the property value. If there is a lock then
7079                         // the property value cannot be changed.
7080                         
7081                         if (PropertyName.IsEmpty()){
7082                         
7083                                 continue;
7084                         
7085                         }
7086                         
7087                         if (PropertyLockMap->find(PropertyName) == PropertyLockMap->end()){
7088                         
7089                                 if (PropertyDataMap->find(PropertyName) == PropertyDataMap->end()){
7090                         
7091                                         PropertyDataMap->insert(std::make_pair(PropertyName, PropertyValue));
7092                         
7093                                 } else {
7094                         
7095                                         PropertyDataMap->erase(PropertyName);
7096                                         PropertyDataMap->insert(std::make_pair(PropertyName, PropertyValue));
7097                         
7098                                 }
7099                                 
7100                         }
7101                         
7102                         //wxSPropertyPropValuesOut->Append(wxT(";"));
7103                         //wxSPropertyPropValuesOut->Append(PropertyName + wxT("=") + PropertyValue);
7104                 
7105                 }
7106                 
7107                 wxSPropertyXVCard4Value->Append(*wxSPropertySeg2Ptr);
7108                 *XVCardV4Value = TRUE;
7109                                 
7110         }
7111         
7112         // X-VCARD4-EMAIL
7113         
7114         if (wxSProperty == wxT("X-VCARD4-EMAIL")){
7115         
7116                 int intPropertyLen;
7117                 
7118                 if (ProcessItemData == TRUE){
7119         
7120                         intPropertyLen = wxSPropertySeg1Chopped.Len();          
7121                 
7122                 } else {
7123                 
7124                         intPropertyLen = wxSPropertySeg1Ptr->Len();
7125                 
7126                 }
7127                 
7128                 std::map<int, int> SplitPoints;
7129                 std::map<int, int> SplitLength;
7130                 std::map<int, int>::iterator SLiter;
7131                 std::map<wxString, bool>::iterator BIter;;                      
7132                 wxString PropertyData;
7133                 wxString PropertyName;
7134                 wxString PropertyValue;
7135                 wxString PropertyTokens;
7136                 bool AfterFirstToken = FALSE;
7137                 bool FirstToken = TRUE;                 
7138                 int intSplitsFound = 0;
7139                 int intSplitSize = 0;
7140                 int intPrevValue = 16;
7141                 int intPref = 0;
7142                 int intType = 0;
7143                 int intSplitSeek = 0;
7146                 if (ProcessItemData == TRUE){
7147                 
7148                         SplitValues(&wxSPropertySeg1Chopped, &SplitPoints, &SplitLength, intPrevValue);
7149                         
7150                 } else {
7151                         
7152                         SplitValues(wxSPropertySeg1Ptr, &SplitPoints, &SplitLength, intPrevValue);
7153                         *wxSPropertyDataNameOut = wxT("EMAIL");
7154                         
7155                 }
7156                 
7157                 for (std::map<int, int>::iterator intiter = SplitPoints.begin(); 
7158                 intiter != SplitPoints.end(); ++intiter){
7159                 
7160                         SLiter = SplitLength.find(intiter->first);
7161                 
7162                         if (ProcessItemData == TRUE){
7164                                 if (FirstToken == TRUE){
7165                 
7166                                         PropertyData = wxSPropertySeg1Chopped.Mid((intPrevValue - 1), (SLiter->second));
7167                                         FirstToken = FALSE;
7168                                 
7169                                 } else {
7170                                 
7171                                         PropertyData = wxSPropertySeg1Chopped.Mid((intPrevValue), (SLiter->second));
7172                                 
7173                                 }
7174                         
7175                         } else {
7176                         
7177                                 if (FirstToken == TRUE){
7178                         
7179                                         PropertyData = wxSPropertySeg1Ptr->Mid((intPrevValue - 1), (SLiter->second));
7180                                         FirstToken = FALSE;
7181                                                                 
7182                                 } else {
7183                                 
7184                                         PropertyData = wxSPropertySeg1Ptr->Mid((intPrevValue), (SLiter->second));
7185                                         
7186                                 }
7187                         
7188                         }
7189                         
7190                         wxStringTokenizer PropertyElement (PropertyData, wxT("="));
7191                         PropertyName = PropertyElement.GetNextToken();                          
7192                         PropertyValue = PropertyElement.GetNextToken();
7193                         
7194                         //ProcessCaptureStrings(&PropertyValue);
7195                         
7196                         intPrevValue = intiter->second;
7197                         
7198                         // Process properties.
7199                         
7200                         // Check if there is a lock on the property value. If there is a lock then
7201                         // the property value cannot be changed.
7202                         
7203                         if (PropertyName.IsEmpty()){
7204                         
7205                                 continue;
7206                         
7207                         }
7208                         
7209                         if (PropertyLockMap->find(PropertyName) == PropertyLockMap->end()){
7210                         
7211                                 if (PropertyDataMap->find(PropertyName) == PropertyDataMap->end()){
7212                         
7213                                         PropertyDataMap->insert(std::make_pair(PropertyName, PropertyValue));
7214                         
7215                                 } else {
7216                         
7217                                         PropertyDataMap->erase(PropertyName);
7218                                         PropertyDataMap->insert(std::make_pair(PropertyName, PropertyValue));
7219                         
7220                                 }
7221                                 
7222                         }
7223                         
7224                         //wxSPropertyPropValuesOut->Append(wxT(";"));
7225                         //wxSPropertyPropValuesOut->Append(PropertyName + wxT("=") + PropertyValue);
7226                 
7227                 }
7228                 
7229                 wxSPropertyXVCard4Value->Append(*wxSPropertySeg2Ptr);
7230                 *XVCardV4Value = TRUE;
7231                                 
7232         }
7233         
7234         // X-VCARD4-IMPP
7235         
7236         if (wxSProperty == wxT("X-VCARD4-IMPP")){
7237         
7238                 int intPropertyLen;
7239                 
7240                 if (ProcessItemData == TRUE){
7241         
7242                         intPropertyLen = wxSPropertySeg1Chopped.Len();          
7243                 
7244                 } else {
7245                 
7246                         intPropertyLen = wxSPropertySeg1Ptr->Len();
7247                 
7248                 }
7249                 
7250                 std::map<int, int> SplitPoints;
7251                 std::map<int, int> SplitLength;
7252                 std::map<int, int>::iterator SLiter;
7253                 std::map<wxString, bool>::iterator BIter;;                      
7254                 wxString PropertyData;
7255                 wxString PropertyName;
7256                 wxString PropertyValue;
7257                 wxString PropertyTokens;
7258                 bool AfterFirstToken = FALSE;
7259                 bool FirstToken = TRUE;                 
7260                 int intSplitsFound = 0;
7261                 int intSplitSize = 0;
7262                 int intPrevValue = 15;
7263                 int intPref = 0;
7264                 int intType = 0;
7265                 int intSplitSeek = 0;
7268                 if (ProcessItemData == TRUE){
7269                 
7270                         SplitValues(&wxSPropertySeg1Chopped, &SplitPoints, &SplitLength, intPrevValue);
7271                         
7272                 } else {
7273                         
7274                         SplitValues(wxSPropertySeg1Ptr, &SplitPoints, &SplitLength, intPrevValue);
7275                         *wxSPropertyDataNameOut = wxT("IMPP");
7276                         
7277                 }
7278                 
7279                 for (std::map<int, int>::iterator intiter = SplitPoints.begin(); 
7280                 intiter != SplitPoints.end(); ++intiter){
7281                 
7282                         SLiter = SplitLength.find(intiter->first);
7283                 
7284                         if (ProcessItemData == TRUE){
7286                                 if (FirstToken == TRUE){
7287                 
7288                                         PropertyData = wxSPropertySeg1Chopped.Mid((intPrevValue - 1), (SLiter->second));
7289                                         FirstToken = FALSE;
7290                                 
7291                                 } else {
7292                                 
7293                                         PropertyData = wxSPropertySeg1Chopped.Mid((intPrevValue), (SLiter->second));
7294                                 
7295                                 }
7296                         
7297                         } else {
7298                         
7299                                 if (FirstToken == TRUE){
7300                         
7301                                         PropertyData = wxSPropertySeg1Ptr->Mid((intPrevValue - 1), (SLiter->second));
7302                                         FirstToken = FALSE;
7303                                                                 
7304                                 } else {
7305                                 
7306                                         PropertyData = wxSPropertySeg1Ptr->Mid((intPrevValue), (SLiter->second));
7307                                         
7308                                 }
7309                         
7310                         }
7311                         
7312                         wxStringTokenizer PropertyElement (PropertyData, wxT("="));
7313                         PropertyName = PropertyElement.GetNextToken();                          
7314                         PropertyValue = PropertyElement.GetNextToken();
7315                         
7316                         //ProcessCaptureStrings(&PropertyValue);
7317                         
7318                         intPrevValue = intiter->second;
7319                         
7320                         // Process properties.
7321                         
7322                         // Check if there is a lock on the property value. If there is a lock then
7323                         // the property value cannot be changed.
7324                         
7325                         if (PropertyName.IsEmpty()){
7326                         
7327                                 continue;
7328                         
7329                         }
7330                         
7331                         if (PropertyLockMap->find(PropertyName) == PropertyLockMap->end()){
7332                         
7333                                 if (PropertyDataMap->find(PropertyName) == PropertyDataMap->end()){
7334                         
7335                                         PropertyDataMap->insert(std::make_pair(PropertyName, PropertyValue));
7336                         
7337                                 } else {
7338                         
7339                                         PropertyDataMap->erase(PropertyName);
7340                                         PropertyDataMap->insert(std::make_pair(PropertyName, PropertyValue));
7341                         
7342                                 }
7343                                 
7344                         }
7345                         
7346                         //wxSPropertyPropValuesOut->Append(wxT(";"));
7347                         //wxSPropertyPropValuesOut->Append(PropertyName + wxT("=") + PropertyValue);
7348                 
7349                 }
7350                 
7351                 wxSPropertyXVCard4Value->Append(*wxSPropertySeg2Ptr);
7352                 *XVCardV4Value = TRUE;
7353                                 
7354         }
7355         
7356         // X-VCARD4-TEL
7357         
7358         if (wxSProperty == wxT("X-VCARD4-TEL")){
7359         
7360                 int intPropertyLen;
7361                 
7362                 if (ProcessItemData == TRUE){
7363         
7364                         intPropertyLen = wxSPropertySeg1Chopped.Len();          
7365                 
7366                 } else {
7367                 
7368                         intPropertyLen = wxSPropertySeg1Ptr->Len();
7369                 
7370                 }
7371                 
7372                 std::map<int, int> SplitPoints;
7373                 std::map<int, int> SplitLength;
7374                 std::map<int, int>::iterator SLiter;
7375                 std::map<wxString, bool>::iterator BIter;;                      
7376                 wxString PropertyData;
7377                 wxString PropertyName;
7378                 wxString PropertyValue;
7379                 wxString PropertyTokens;
7380                 bool AfterFirstToken = FALSE;
7381                 bool FirstToken = TRUE;                 
7382                 int intSplitsFound = 0;
7383                 int intSplitSize = 0;
7384                 int intPrevValue = 14;
7385                 int intPref = 0;
7386                 int intType = 0;
7387                 int intSplitSeek = 0;
7390                 if (ProcessItemData == TRUE){
7391                 
7392                         SplitValues(&wxSPropertySeg1Chopped, &SplitPoints, &SplitLength, intPrevValue);
7393                         
7394                 } else {
7395                         
7396                         SplitValues(wxSPropertySeg1Ptr, &SplitPoints, &SplitLength, intPrevValue);
7397                         *wxSPropertyDataNameOut = wxT("TEL");
7398                         
7399                 }
7400                 
7401                 for (std::map<int, int>::iterator intiter = SplitPoints.begin(); 
7402                 intiter != SplitPoints.end(); ++intiter){
7403                 
7404                         SLiter = SplitLength.find(intiter->first);
7405                 
7406                         if (ProcessItemData == TRUE){
7408                                 if (FirstToken == TRUE){
7409                 
7410                                         PropertyData = wxSPropertySeg1Chopped.Mid((intPrevValue - 1), (SLiter->second));
7411                                         FirstToken = FALSE;
7412                                 
7413                                 } else {
7414                                 
7415                                         PropertyData = wxSPropertySeg1Chopped.Mid((intPrevValue), (SLiter->second));
7416                                 
7417                                 }
7418                         
7419                         } else {
7420                         
7421                                 if (FirstToken == TRUE){
7422                         
7423                                         PropertyData = wxSPropertySeg1Ptr->Mid((intPrevValue - 1), (SLiter->second));
7424                                         FirstToken = FALSE;
7425                                                                 
7426                                 } else {
7427                                 
7428                                         PropertyData = wxSPropertySeg1Ptr->Mid((intPrevValue), (SLiter->second));
7429                                         
7430                                 }
7431                         
7432                         }
7433                         
7434                         wxStringTokenizer PropertyElement (PropertyData, wxT("="));
7435                         PropertyName = PropertyElement.GetNextToken();                          
7436                         PropertyValue = PropertyElement.GetNextToken();
7437                         
7438                         //ProcessCaptureStrings(&PropertyValue);
7439                         
7440                         intPrevValue = intiter->second;
7441                         
7442                         // Process properties.
7443                         
7444                         // Check if there is a lock on the property value. If there is a lock then
7445                         // the property value cannot be changed.
7446                         
7447                         if (PropertyName.IsEmpty()){
7448                         
7449                                 continue;
7450                         
7451                         }
7452                         
7453                         if (PropertyLockMap->find(PropertyName) == PropertyLockMap->end()){
7454                         
7455                                 if (PropertyDataMap->find(PropertyName) == PropertyDataMap->end()){
7456                         
7457                                         PropertyDataMap->insert(std::make_pair(PropertyName, PropertyValue));
7458                         
7459                                 } else {
7460                         
7461                                         PropertyDataMap->erase(PropertyName);
7462                                         PropertyDataMap->insert(std::make_pair(PropertyName, PropertyValue));
7463                         
7464                                 }
7465                                 
7466                         }
7467                         
7468                         //wxSPropertyPropValuesOut->Append(wxT(";"));
7469                         //wxSPropertyPropValuesOut->Append(PropertyName + wxT("=") + PropertyValue);
7470                 
7471                 }
7472                 
7473                 wxSPropertyXVCard4Value->Append(*wxSPropertySeg2Ptr);
7474                 *XVCardV4Value = TRUE;
7475                                 
7476         }
7477         
7478         // X-VCARD4-LANG
7479         
7480         if (wxSProperty == wxT("X-VCARD4-LANG")){
7481         
7482                 int intPropertyLen;
7483                 
7484                 if (ProcessItemData == TRUE){
7485         
7486                         intPropertyLen = wxSPropertySeg1Chopped.Len();          
7487                 
7488                 } else {
7489                 
7490                         intPropertyLen = wxSPropertySeg1Ptr->Len();
7491                 
7492                 }
7493                 
7494                 std::map<int, int> SplitPoints;
7495                 std::map<int, int> SplitLength;
7496                 std::map<int, int>::iterator SLiter;
7497                 std::map<wxString, bool>::iterator BIter;;                      
7498                 wxString PropertyData;
7499                 wxString PropertyName;
7500                 wxString PropertyValue;
7501                 wxString PropertyTokens;
7502                 bool AfterFirstToken = FALSE;
7503                 bool FirstToken = TRUE;                 
7504                 int intSplitsFound = 0;
7505                 int intSplitSize = 0;
7506                 int intPrevValue = 15;
7507                 int intPref = 0;
7508                 int intType = 0;
7509                 int intSplitSeek = 0;
7512                 if (ProcessItemData == TRUE){
7513                 
7514                         SplitValues(&wxSPropertySeg1Chopped, &SplitPoints, &SplitLength, intPrevValue);
7515                         
7516                 } else {
7517                         
7518                         SplitValues(wxSPropertySeg1Ptr, &SplitPoints, &SplitLength, intPrevValue);
7519                         *wxSPropertyDataNameOut = wxT("LANG");
7520                         
7521                 }
7522                 
7523                 for (std::map<int, int>::iterator intiter = SplitPoints.begin(); 
7524                 intiter != SplitPoints.end(); ++intiter){
7525                 
7526                         SLiter = SplitLength.find(intiter->first);
7527                 
7528                         if (ProcessItemData == TRUE){
7530                                 if (FirstToken == TRUE){
7531                 
7532                                         PropertyData = wxSPropertySeg1Chopped.Mid((intPrevValue - 1), (SLiter->second));
7533                                         FirstToken = FALSE;
7534                                 
7535                                 } else {
7536                                 
7537                                         PropertyData = wxSPropertySeg1Chopped.Mid((intPrevValue), (SLiter->second));
7538                                 
7539                                 }
7540                         
7541                         } else {
7542                         
7543                                 if (FirstToken == TRUE){
7544                         
7545                                         PropertyData = wxSPropertySeg1Ptr->Mid((intPrevValue - 1), (SLiter->second));
7546                                         FirstToken = FALSE;
7547                                                                 
7548                                 } else {
7549                                 
7550                                         PropertyData = wxSPropertySeg1Ptr->Mid((intPrevValue), (SLiter->second));
7551                                         
7552                                 }
7553                         
7554                         }
7555                         
7556                         wxStringTokenizer PropertyElement (PropertyData, wxT("="));
7557                         PropertyName = PropertyElement.GetNextToken();                          
7558                         PropertyValue = PropertyElement.GetNextToken();
7559                         
7560                         //ProcessCaptureStrings(&PropertyValue);
7561                         
7562                         intPrevValue = intiter->second;
7563                         
7564                         // Process properties.
7565                         
7566                         // Check if there is a lock on the property value. If there is a lock then
7567                         // the property value cannot be changed.
7568                         
7569                         if (PropertyName.IsEmpty()){
7570                         
7571                                 continue;
7572                         
7573                         }
7574                         
7575                         if (PropertyLockMap->find(PropertyName) == PropertyLockMap->end()){
7576                         
7577                                 if (PropertyDataMap->find(PropertyName) == PropertyDataMap->end()){
7578                         
7579                                         PropertyDataMap->insert(std::make_pair(PropertyName, PropertyValue));
7580                         
7581                                 } else {
7582                         
7583                                         PropertyDataMap->erase(PropertyName);
7584                                         PropertyDataMap->insert(std::make_pair(PropertyName, PropertyValue));
7585                         
7586                                 }
7587                                 
7588                         }
7589                         
7590                         //wxSPropertyPropValuesOut->Append(wxT(";"));
7591                         //wxSPropertyPropValuesOut->Append(PropertyName + wxT("=") + PropertyValue);
7592                 
7593                 }
7594                 
7595                 wxSPropertyXVCard4Value->Append(*wxSPropertySeg2Ptr);
7596                 *XVCardV4Value = TRUE;
7597                                 
7598         }
7599         
7600         // X-VCARD4-GEO
7601         
7602         if (wxSProperty == wxT("X-VCARD4-GEO")){
7603         
7604                 int intPropertyLen;
7605                 
7606                 if (ProcessItemData == TRUE){
7607         
7608                         intPropertyLen = wxSPropertySeg1Chopped.Len();          
7609                 
7610                 } else {
7611                 
7612                         intPropertyLen = wxSPropertySeg1Ptr->Len();
7613                 
7614                 }
7615                 
7616                 std::map<int, int> SplitPoints;
7617                 std::map<int, int> SplitLength;
7618                 std::map<int, int>::iterator SLiter;
7619                 std::map<wxString, bool>::iterator BIter;;                      
7620                 wxString PropertyData;
7621                 wxString PropertyName;
7622                 wxString PropertyValue;
7623                 wxString PropertyTokens;
7624                 bool AfterFirstToken = FALSE;
7625                 bool FirstToken = TRUE;                 
7626                 int intSplitsFound = 0;
7627                 int intSplitSize = 0;
7628                 int intPrevValue = 14;
7629                 int intPref = 0;
7630                 int intType = 0;
7631                 int intSplitSeek = 0;
7634                 if (ProcessItemData == TRUE){
7635                 
7636                         SplitValues(&wxSPropertySeg1Chopped, &SplitPoints, &SplitLength, intPrevValue);
7637                         
7638                 } else {
7639                         
7640                         SplitValues(wxSPropertySeg1Ptr, &SplitPoints, &SplitLength, intPrevValue);
7641                         *wxSPropertyDataNameOut = wxT("GEO");
7642                         
7643                 }
7644                 
7645                 for (std::map<int, int>::iterator intiter = SplitPoints.begin(); 
7646                 intiter != SplitPoints.end(); ++intiter){
7647                 
7648                         SLiter = SplitLength.find(intiter->first);
7649                 
7650                         if (ProcessItemData == TRUE){
7652                                 if (FirstToken == TRUE){
7653                 
7654                                         PropertyData = wxSPropertySeg1Chopped.Mid((intPrevValue - 1), (SLiter->second));
7655                                         FirstToken = FALSE;
7656                                 
7657                                 } else {
7658                                 
7659                                         PropertyData = wxSPropertySeg1Chopped.Mid((intPrevValue), (SLiter->second));
7660                                 
7661                                 }
7662                         
7663                         } else {
7664                         
7665                                 if (FirstToken == TRUE){
7666                         
7667                                         PropertyData = wxSPropertySeg1Ptr->Mid((intPrevValue - 1), (SLiter->second));
7668                                         FirstToken = FALSE;
7669                                                                 
7670                                 } else {
7671                                 
7672                                         PropertyData = wxSPropertySeg1Ptr->Mid((intPrevValue), (SLiter->second));
7673                                         
7674                                 }
7675                         
7676                         }
7677                         
7678                         wxStringTokenizer PropertyElement (PropertyData, wxT("="));
7679                         PropertyName = PropertyElement.GetNextToken();                          
7680                         PropertyValue = PropertyElement.GetNextToken();
7681                         
7682                         //ProcessCaptureStrings(&PropertyValue);
7683                         
7684                         intPrevValue = intiter->second;
7685                         
7686                         // Process properties.
7687                         
7688                         // Check if there is a lock on the property value. If there is a lock then
7689                         // the property value cannot be changed.
7690                         
7691                         if (PropertyName.IsEmpty()){
7692                         
7693                                 continue;
7694                         
7695                         }
7696                         
7697                         if (PropertyLockMap->find(PropertyName) == PropertyLockMap->end()){
7698                         
7699                                 if (PropertyDataMap->find(PropertyName) == PropertyDataMap->end()){
7700                         
7701                                         PropertyDataMap->insert(std::make_pair(PropertyName, PropertyValue));
7702                         
7703                                 } else {
7704                         
7705                                         PropertyDataMap->erase(PropertyName);
7706                                         PropertyDataMap->insert(std::make_pair(PropertyName, PropertyValue));
7707                         
7708                                 }
7709                                 
7710                         }
7711                         
7712                         //wxSPropertyPropValuesOut->Append(wxT(";"));
7713                         //wxSPropertyPropValuesOut->Append(PropertyName + wxT("=") + PropertyValue);
7714                 
7715                 }
7716                 
7717                 wxSPropertyXVCard4Value->Append(*wxSPropertySeg2Ptr);
7718                 *XVCardV4Value = TRUE;
7719                                 
7720         }
7721         
7722         // X-VCARD4-RELATED
7723         
7724         if (wxSProperty == wxT("X-VCARD4-RELATED")){
7725         
7726                 int intPropertyLen;
7727                 
7728                 if (ProcessItemData == TRUE){
7729         
7730                         intPropertyLen = wxSPropertySeg1Chopped.Len();          
7731                 
7732                 } else {
7733                 
7734                         intPropertyLen = wxSPropertySeg1Ptr->Len();
7735                 
7736                 }
7737                 
7738                 std::map<int, int> SplitPoints;
7739                 std::map<int, int> SplitLength;
7740                 std::map<int, int>::iterator SLiter;
7741                 std::map<wxString, bool>::iterator BIter;;                      
7742                 wxString PropertyData;
7743                 wxString PropertyName;
7744                 wxString PropertyValue;
7745                 wxString PropertyTokens;
7746                 bool AfterFirstToken = FALSE;
7747                 bool FirstToken = TRUE;                 
7748                 int intSplitsFound = 0;
7749                 int intSplitSize = 0;
7750                 int intPrevValue = 18;
7751                 int intPref = 0;
7752                 int intType = 0;
7753                 int intSplitSeek = 0;
7756                 if (ProcessItemData == TRUE){
7757                 
7758                         SplitValues(&wxSPropertySeg1Chopped, &SplitPoints, &SplitLength, intPrevValue);
7759                         
7760                 } else {
7761                         
7762                         SplitValues(wxSPropertySeg1Ptr, &SplitPoints, &SplitLength, intPrevValue);
7763                         *wxSPropertyDataNameOut = wxT("RELATED");
7764                         
7765                 }
7766                 
7767                 for (std::map<int, int>::iterator intiter = SplitPoints.begin(); 
7768                 intiter != SplitPoints.end(); ++intiter){
7769                 
7770                         SLiter = SplitLength.find(intiter->first);
7771                 
7772                         if (ProcessItemData == TRUE){
7774                                 if (FirstToken == TRUE){
7775                 
7776                                         PropertyData = wxSPropertySeg1Chopped.Mid((intPrevValue - 1), (SLiter->second));
7777                                         FirstToken = FALSE;
7778                                 
7779                                 } else {
7780                                 
7781                                         PropertyData = wxSPropertySeg1Chopped.Mid((intPrevValue), (SLiter->second));
7782                                 
7783                                 }
7784                         
7785                         } else {
7786                         
7787                                 if (FirstToken == TRUE){
7788                         
7789                                         PropertyData = wxSPropertySeg1Ptr->Mid((intPrevValue - 1), (SLiter->second));
7790                                         FirstToken = FALSE;
7791                                                                 
7792                                 } else {
7793                                 
7794                                         PropertyData = wxSPropertySeg1Ptr->Mid((intPrevValue), (SLiter->second));
7795                                         
7796                                 }
7797                         
7798                         }
7799                         
7800                         wxStringTokenizer PropertyElement (PropertyData, wxT("="));
7801                         PropertyName = PropertyElement.GetNextToken();                          
7802                         PropertyValue = PropertyElement.GetNextToken();
7803                         
7804                         //ProcessCaptureStrings(&PropertyValue);
7805                         
7806                         intPrevValue = intiter->second;
7807                         
7808                         // Process properties.
7809                         
7810                         // Check if there is a lock on the property value. If there is a lock then
7811                         // the property value cannot be changed.
7812                         
7813                         if (PropertyName.IsEmpty()){
7814                         
7815                                 continue;
7816                         
7817                         }
7818                         
7819                         if (PropertyLockMap->find(PropertyName) == PropertyLockMap->end()){
7820                         
7821                                 if (PropertyDataMap->find(PropertyName) == PropertyDataMap->end()){
7822                         
7823                                         PropertyDataMap->insert(std::make_pair(PropertyName, PropertyValue));
7824                         
7825                                 } else {
7826                         
7827                                         PropertyDataMap->erase(PropertyName);
7828                                         PropertyDataMap->insert(std::make_pair(PropertyName, PropertyValue));
7829                         
7830                                 }
7831                                 
7832                         }
7833                         
7834                         //wxSPropertyPropValuesOut->Append(wxT(";"));
7835                         //wxSPropertyPropValuesOut->Append(PropertyName + wxT("=") + PropertyValue);
7836                 
7837                 }
7838                 
7839                 wxSPropertyXVCard4Value->Append(*wxSPropertySeg2Ptr);
7840                 *XVCardV4Value = TRUE;
7841                                 
7842         }
7843         
7844         // X-VCARD4-URL
7845         
7846         if (wxSProperty == wxT("X-VCARD4-URL")){
7847         
7848                 int intPropertyLen;
7849                 
7850                 if (ProcessItemData == TRUE){
7851         
7852                         intPropertyLen = wxSPropertySeg1Chopped.Len();          
7853                 
7854                 } else {
7855                 
7856                         intPropertyLen = wxSPropertySeg1Ptr->Len();
7857                 
7858                 }
7859                 
7860                 std::map<int, int> SplitPoints;
7861                 std::map<int, int> SplitLength;
7862                 std::map<int, int>::iterator SLiter;
7863                 std::map<wxString, bool>::iterator BIter;;                      
7864                 wxString PropertyData;
7865                 wxString PropertyName;
7866                 wxString PropertyValue;
7867                 wxString PropertyTokens;
7868                 bool AfterFirstToken = FALSE;
7869                 bool FirstToken = TRUE;                 
7870                 int intSplitsFound = 0;
7871                 int intSplitSize = 0;
7872                 int intPrevValue = 14;
7873                 int intPref = 0;
7874                 int intType = 0;
7875                 int intSplitSeek = 0;
7878                 if (ProcessItemData == TRUE){
7879                 
7880                         SplitValues(&wxSPropertySeg1Chopped, &SplitPoints, &SplitLength, intPrevValue);
7881                         
7882                 } else {
7883                         
7884                         SplitValues(wxSPropertySeg1Ptr, &SplitPoints, &SplitLength, intPrevValue);
7885                         *wxSPropertyDataNameOut = wxT("URL");
7886                         
7887                 }
7888                 
7889                 for (std::map<int, int>::iterator intiter = SplitPoints.begin(); 
7890                 intiter != SplitPoints.end(); ++intiter){
7891                 
7892                         SLiter = SplitLength.find(intiter->first);
7893                 
7894                         if (ProcessItemData == TRUE){
7896                                 if (FirstToken == TRUE){
7897                 
7898                                         PropertyData = wxSPropertySeg1Chopped.Mid((intPrevValue - 1), (SLiter->second));
7899                                         FirstToken = FALSE;
7900                                 
7901                                 } else {
7902                                 
7903                                         PropertyData = wxSPropertySeg1Chopped.Mid((intPrevValue), (SLiter->second));
7904                                 
7905                                 }
7906                         
7907                         } else {
7908                         
7909                                 if (FirstToken == TRUE){
7910                         
7911                                         PropertyData = wxSPropertySeg1Ptr->Mid((intPrevValue - 1), (SLiter->second));
7912                                         FirstToken = FALSE;
7913                                                                 
7914                                 } else {
7915                                 
7916                                         PropertyData = wxSPropertySeg1Ptr->Mid((intPrevValue), (SLiter->second));
7917                                         
7918                                 }
7919                         
7920                         }
7921                         
7922                         wxStringTokenizer PropertyElement (PropertyData, wxT("="));
7923                         PropertyName = PropertyElement.GetNextToken();                          
7924                         PropertyValue = PropertyElement.GetNextToken();
7925                         
7926                         //ProcessCaptureStrings(&PropertyValue);
7927                         
7928                         intPrevValue = intiter->second;
7929                         
7930                         // Process properties.
7931                         
7932                         // Check if there is a lock on the property value. If there is a lock then
7933                         // the property value cannot be changed.
7934                         
7935                         if (PropertyName.IsEmpty()){
7936                         
7937                                 continue;
7938                         
7939                         }
7940                         
7941                         if (PropertyLockMap->find(PropertyName) == PropertyLockMap->end()){
7942                         
7943                                 if (PropertyDataMap->find(PropertyName) == PropertyDataMap->end()){
7944                         
7945                                         PropertyDataMap->insert(std::make_pair(PropertyName, PropertyValue));
7946                         
7947                                 } else {
7948                         
7949                                         PropertyDataMap->erase(PropertyName);
7950                                         PropertyDataMap->insert(std::make_pair(PropertyName, PropertyValue));
7951                         
7952                                 }
7953                                 
7954                         }
7955                         
7956                         //wxSPropertyPropValuesOut->Append(wxT(";"));
7957                         //wxSPropertyPropValuesOut->Append(PropertyName + wxT("=") + PropertyValue);
7958                 
7959                 }
7960                 
7961                 wxSPropertyXVCard4Value->Append(*wxSPropertySeg2Ptr);
7962                 *XVCardV4Value = TRUE;
7963                                 
7964         }
7965         
7966         // X-VCARD4-TITLE
7967         
7968         if (wxSProperty == wxT("X-VCARD4-TITLE")){
7969         
7970                 int intPropertyLen;
7971                 
7972                 if (ProcessItemData == TRUE){
7973         
7974                         intPropertyLen = wxSPropertySeg1Chopped.Len();          
7975                 
7976                 } else {
7977                 
7978                         intPropertyLen = wxSPropertySeg1Ptr->Len();
7979                 
7980                 }
7981                 
7982                 std::map<int, int> SplitPoints;
7983                 std::map<int, int> SplitLength;
7984                 std::map<int, int>::iterator SLiter;
7985                 std::map<wxString, bool>::iterator BIter;;                      
7986                 wxString PropertyData;
7987                 wxString PropertyName;
7988                 wxString PropertyValue;
7989                 wxString PropertyTokens;
7990                 bool AfterFirstToken = FALSE;
7991                 bool FirstToken = TRUE;                 
7992                 int intSplitsFound = 0;
7993                 int intSplitSize = 0;
7994                 int intPrevValue = 16;
7995                 int intPref = 0;
7996                 int intType = 0;
7997                 int intSplitSeek = 0;
8000                 if (ProcessItemData == TRUE){
8001                 
8002                         SplitValues(&wxSPropertySeg1Chopped, &SplitPoints, &SplitLength, intPrevValue);
8003                         
8004                 } else {
8005                         
8006                         SplitValues(wxSPropertySeg1Ptr, &SplitPoints, &SplitLength, intPrevValue);
8007                         *wxSPropertyDataNameOut = wxT("TITLE");
8008                         
8009                 }
8010                 
8011                 for (std::map<int, int>::iterator intiter = SplitPoints.begin(); 
8012                 intiter != SplitPoints.end(); ++intiter){
8013                 
8014                         SLiter = SplitLength.find(intiter->first);
8015                 
8016                         if (ProcessItemData == TRUE){
8018                                 if (FirstToken == TRUE){
8019                 
8020                                         PropertyData = wxSPropertySeg1Chopped.Mid((intPrevValue - 1), (SLiter->second));
8021                                         FirstToken = FALSE;
8022                                 
8023                                 } else {
8024                                 
8025                                         PropertyData = wxSPropertySeg1Chopped.Mid((intPrevValue), (SLiter->second));
8026                                 
8027                                 }
8028                         
8029                         } else {
8030                         
8031                                 if (FirstToken == TRUE){
8032                         
8033                                         PropertyData = wxSPropertySeg1Ptr->Mid((intPrevValue - 1), (SLiter->second));
8034                                         FirstToken = FALSE;
8035                                                                 
8036                                 } else {
8037                                 
8038                                         PropertyData = wxSPropertySeg1Ptr->Mid((intPrevValue), (SLiter->second));
8039                                         
8040                                 }
8041                         
8042                         }
8043                         
8044                         wxStringTokenizer PropertyElement (PropertyData, wxT("="));
8045                         PropertyName = PropertyElement.GetNextToken();                          
8046                         PropertyValue = PropertyElement.GetNextToken();
8047                         
8048                         //ProcessCaptureStrings(&PropertyValue);
8049                         
8050                         intPrevValue = intiter->second;
8051                         
8052                         // Process properties.
8053                         
8054                         // Check if there is a lock on the property value. If there is a lock then
8055                         // the property value cannot be changed.
8056                         
8057                         if (PropertyName.IsEmpty()){
8058                         
8059                                 continue;
8060                         
8061                         }
8062                         
8063                         if (PropertyLockMap->find(PropertyName) == PropertyLockMap->end()){
8064                         
8065                                 if (PropertyDataMap->find(PropertyName) == PropertyDataMap->end()){
8066                         
8067                                         PropertyDataMap->insert(std::make_pair(PropertyName, PropertyValue));
8068                         
8069                                 } else {
8070                         
8071                                         PropertyDataMap->erase(PropertyName);
8072                                         PropertyDataMap->insert(std::make_pair(PropertyName, PropertyValue));
8073                         
8074                                 }
8075                                 
8076                         }
8077                         
8078                         //wxSPropertyPropValuesOut->Append(wxT(";"));
8079                         //wxSPropertyPropValuesOut->Append(PropertyName + wxT("=") + PropertyValue);
8080                 
8081                 }
8082                 
8083                 wxSPropertyXVCard4Value->Append(*wxSPropertySeg2Ptr);
8084                 *XVCardV4Value = TRUE;
8085                                 
8086         }
8087         
8088         // X-VCARD4-ROLE
8089         
8090         if (wxSProperty == wxT("X-VCARD4-ROLE")){
8091         
8092                 int intPropertyLen;
8093                 
8094                 if (ProcessItemData == TRUE){
8095         
8096                         intPropertyLen = wxSPropertySeg1Chopped.Len();          
8097                 
8098                 } else {
8099                 
8100                         intPropertyLen = wxSPropertySeg1Ptr->Len();
8101                 
8102                 }
8103                 
8104                 std::map<int, int> SplitPoints;
8105                 std::map<int, int> SplitLength;
8106                 std::map<int, int>::iterator SLiter;
8107                 std::map<wxString, bool>::iterator BIter;;                      
8108                 wxString PropertyData;
8109                 wxString PropertyName;
8110                 wxString PropertyValue;
8111                 wxString PropertyTokens;
8112                 bool AfterFirstToken = FALSE;
8113                 bool FirstToken = TRUE;                 
8114                 int intSplitsFound = 0;
8115                 int intSplitSize = 0;
8116                 int intPrevValue = 15;
8117                 int intPref = 0;
8118                 int intType = 0;
8119                 int intSplitSeek = 0;
8122                 if (ProcessItemData == TRUE){
8123                 
8124                         SplitValues(&wxSPropertySeg1Chopped, &SplitPoints, &SplitLength, intPrevValue);
8125                         
8126                 } else {
8127                         
8128                         SplitValues(wxSPropertySeg1Ptr, &SplitPoints, &SplitLength, intPrevValue);
8129                         *wxSPropertyDataNameOut = wxT("ROLE");
8130                         
8131                 }
8132                 
8133                 for (std::map<int, int>::iterator intiter = SplitPoints.begin(); 
8134                 intiter != SplitPoints.end(); ++intiter){
8135                 
8136                         SLiter = SplitLength.find(intiter->first);
8137                 
8138                         if (ProcessItemData == TRUE){
8140                                 if (FirstToken == TRUE){
8141                 
8142                                         PropertyData = wxSPropertySeg1Chopped.Mid((intPrevValue - 1), (SLiter->second));
8143                                         FirstToken = FALSE;
8144                                 
8145                                 } else {
8146                                 
8147                                         PropertyData = wxSPropertySeg1Chopped.Mid((intPrevValue), (SLiter->second));
8148                                 
8149                                 }
8150                         
8151                         } else {
8152                         
8153                                 if (FirstToken == TRUE){
8154                         
8155                                         PropertyData = wxSPropertySeg1Ptr->Mid((intPrevValue - 1), (SLiter->second));
8156                                         FirstToken = FALSE;
8157                                                                 
8158                                 } else {
8159                                 
8160                                         PropertyData = wxSPropertySeg1Ptr->Mid((intPrevValue), (SLiter->second));
8161                                         
8162                                 }
8163                         
8164                         }
8165                         
8166                         wxStringTokenizer PropertyElement (PropertyData, wxT("="));
8167                         PropertyName = PropertyElement.GetNextToken();                          
8168                         PropertyValue = PropertyElement.GetNextToken();
8169                         
8170                         //ProcessCaptureStrings(&PropertyValue);
8171                         
8172                         intPrevValue = intiter->second;
8173                         
8174                         // Process properties.
8175                         
8176                         // Check if there is a lock on the property value. If there is a lock then
8177                         // the property value cannot be changed.
8178                         
8179                         if (PropertyName.IsEmpty()){
8180                         
8181                                 continue;
8182                         
8183                         }
8184                         
8185                         if (PropertyLockMap->find(PropertyName) == PropertyLockMap->end()){
8186                         
8187                                 if (PropertyDataMap->find(PropertyName) == PropertyDataMap->end()){
8188                         
8189                                         PropertyDataMap->insert(std::make_pair(PropertyName, PropertyValue));
8190                         
8191                                 } else {
8192                         
8193                                         PropertyDataMap->erase(PropertyName);
8194                                         PropertyDataMap->insert(std::make_pair(PropertyName, PropertyValue));
8195                         
8196                                 }
8197                                 
8198                         }
8199                         
8200                         //wxSPropertyPropValuesOut->Append(wxT(";"));
8201                         //wxSPropertyPropValuesOut->Append(PropertyName + wxT("=") + PropertyValue);
8202                 
8203                 }
8204                 
8205                 wxSPropertyXVCard4Value->Append(*wxSPropertySeg2Ptr);
8206                 *XVCardV4Value = TRUE;
8207                                 
8208         }
8209         
8210         // X-VCARD4-ORG
8211         
8212         if (wxSProperty == wxT("X-VCARD4-ORG")){
8213         
8214                 int intPropertyLen;
8215                 
8216                 if (ProcessItemData == TRUE){
8217         
8218                         intPropertyLen = wxSPropertySeg1Chopped.Len();          
8219                 
8220                 } else {
8221                 
8222                         intPropertyLen = wxSPropertySeg1Ptr->Len();
8223                 
8224                 }
8225                 
8226                 std::map<int, int> SplitPoints;
8227                 std::map<int, int> SplitLength;
8228                 std::map<int, int>::iterator SLiter;
8229                 std::map<wxString, bool>::iterator BIter;;                      
8230                 wxString PropertyData;
8231                 wxString PropertyName;
8232                 wxString PropertyValue;
8233                 wxString PropertyTokens;
8234                 bool AfterFirstToken = FALSE;
8235                 bool FirstToken = TRUE;                 
8236                 int intSplitsFound = 0;
8237                 int intSplitSize = 0;
8238                 int intPrevValue = 14;
8239                 int intPref = 0;
8240                 int intType = 0;
8241                 int intSplitSeek = 0;
8244                 if (ProcessItemData == TRUE){
8245                 
8246                         SplitValues(&wxSPropertySeg1Chopped, &SplitPoints, &SplitLength, intPrevValue);
8247                         
8248                 } else {
8249                         
8250                         SplitValues(wxSPropertySeg1Ptr, &SplitPoints, &SplitLength, intPrevValue);
8251                         *wxSPropertyDataNameOut = wxT("ORG");
8252                         
8253                 }
8254                 
8255                 for (std::map<int, int>::iterator intiter = SplitPoints.begin(); 
8256                 intiter != SplitPoints.end(); ++intiter){
8257                 
8258                         SLiter = SplitLength.find(intiter->first);
8259                 
8260                         if (ProcessItemData == TRUE){
8262                                 if (FirstToken == TRUE){
8263                 
8264                                         PropertyData = wxSPropertySeg1Chopped.Mid((intPrevValue - 1), (SLiter->second));
8265                                         FirstToken = FALSE;
8266                                 
8267                                 } else {
8268                                 
8269                                         PropertyData = wxSPropertySeg1Chopped.Mid((intPrevValue), (SLiter->second));
8270                                 
8271                                 }
8272                         
8273                         } else {
8274                         
8275                                 if (FirstToken == TRUE){
8276                         
8277                                         PropertyData = wxSPropertySeg1Ptr->Mid((intPrevValue - 1), (SLiter->second));
8278                                         FirstToken = FALSE;
8279                                                                 
8280                                 } else {
8281                                 
8282                                         PropertyData = wxSPropertySeg1Ptr->Mid((intPrevValue), (SLiter->second));
8283                                         
8284                                 }
8285                         
8286                         }
8287                         
8288                         wxStringTokenizer PropertyElement (PropertyData, wxT("="));
8289                         PropertyName = PropertyElement.GetNextToken();                          
8290                         PropertyValue = PropertyElement.GetNextToken();
8291                         
8292                         //ProcessCaptureStrings(&PropertyValue);
8293                         
8294                         intPrevValue = intiter->second;
8295                         
8296                         // Process properties.
8297                         
8298                         // Check if there is a lock on the property value. If there is a lock then
8299                         // the property value cannot be changed.
8300                         
8301                         if (PropertyName.IsEmpty()){
8302                         
8303                                 continue;
8304                         
8305                         }
8306                         
8307                         if (PropertyLockMap->find(PropertyName) == PropertyLockMap->end()){
8308                         
8309                                 if (PropertyDataMap->find(PropertyName) == PropertyDataMap->end()){
8310                         
8311                                         PropertyDataMap->insert(std::make_pair(PropertyName, PropertyValue));
8312                         
8313                                 } else {
8314                         
8315                                         PropertyDataMap->erase(PropertyName);
8316                                         PropertyDataMap->insert(std::make_pair(PropertyName, PropertyValue));
8317                         
8318                                 }
8319                                 
8320                         }
8321                         
8322                         //wxSPropertyPropValuesOut->Append(wxT(";"));
8323                         //wxSPropertyPropValuesOut->Append(PropertyName + wxT("=") + PropertyValue);
8324                 
8325                 }
8326                 
8327                 wxSPropertyXVCard4Value->Append(*wxSPropertySeg2Ptr);
8328                 *XVCardV4Value = TRUE;
8329                                 
8330         }
8331         
8332         // X-VCARD4-NOTE
8333         
8334         if (wxSProperty == wxT("X-VCARD4-NOTE")){
8335         
8336                 int intPropertyLen;
8337                 
8338                 if (ProcessItemData == TRUE){
8339         
8340                         intPropertyLen = wxSPropertySeg1Chopped.Len();          
8341                 
8342                 } else {
8343                 
8344                         intPropertyLen = wxSPropertySeg1Ptr->Len();
8345                 
8346                 }
8347                 
8348                 std::map<int, int> SplitPoints;
8349                 std::map<int, int> SplitLength;
8350                 std::map<int, int>::iterator SLiter;
8351                 std::map<wxString, bool>::iterator BIter;;                      
8352                 wxString PropertyData;
8353                 wxString PropertyName;
8354                 wxString PropertyValue;
8355                 wxString PropertyTokens;
8356                 bool AfterFirstToken = FALSE;
8357                 bool FirstToken = TRUE;                 
8358                 int intSplitsFound = 0;
8359                 int intSplitSize = 0;
8360                 int intPrevValue = 15;
8361                 int intPref = 0;
8362                 int intType = 0;
8363                 int intSplitSeek = 0;
8366                 if (ProcessItemData == TRUE){
8367                 
8368                         SplitValues(&wxSPropertySeg1Chopped, &SplitPoints, &SplitLength, intPrevValue);
8369                         
8370                 } else {
8371                         
8372                         SplitValues(wxSPropertySeg1Ptr, &SplitPoints, &SplitLength, intPrevValue);
8373                         *wxSPropertyDataNameOut = wxT("NOTE");
8374                         
8375                 }
8376                 
8377                 for (std::map<int, int>::iterator intiter = SplitPoints.begin(); 
8378                 intiter != SplitPoints.end(); ++intiter){
8379                 
8380                         SLiter = SplitLength.find(intiter->first);
8381                 
8382                         if (ProcessItemData == TRUE){
8384                                 if (FirstToken == TRUE){
8385                 
8386                                         PropertyData = wxSPropertySeg1Chopped.Mid((intPrevValue - 1), (SLiter->second));
8387                                         FirstToken = FALSE;
8388                                 
8389                                 } else {
8390                                 
8391                                         PropertyData = wxSPropertySeg1Chopped.Mid((intPrevValue), (SLiter->second));
8392                                 
8393                                 }
8394                         
8395                         } else {
8396                         
8397                                 if (FirstToken == TRUE){
8398                         
8399                                         PropertyData = wxSPropertySeg1Ptr->Mid((intPrevValue - 1), (SLiter->second));
8400                                         FirstToken = FALSE;
8401                                                                 
8402                                 } else {
8403                                 
8404                                         PropertyData = wxSPropertySeg1Ptr->Mid((intPrevValue), (SLiter->second));
8405                                         
8406                                 }
8407                         
8408                         }
8409                         
8410                         wxStringTokenizer PropertyElement (PropertyData, wxT("="));
8411                         PropertyName = PropertyElement.GetNextToken();                          
8412                         PropertyValue = PropertyElement.GetNextToken();
8413                         
8414                         //ProcessCaptureStrings(&PropertyValue);
8415                         
8416                         intPrevValue = intiter->second;
8417                         
8418                         // Process properties.
8419                         
8420                         // Check if there is a lock on the property value. If there is a lock then
8421                         // the property value cannot be changed.
8422                         
8423                         if (PropertyName.IsEmpty()){
8424                         
8425                                 continue;
8426                         
8427                         }
8428                         
8429                         if (PropertyLockMap->find(PropertyName) == PropertyLockMap->end()){
8430                         
8431                                 if (PropertyDataMap->find(PropertyName) == PropertyDataMap->end()){
8432                         
8433                                         PropertyDataMap->insert(std::make_pair(PropertyName, PropertyValue));
8434                         
8435                                 } else {
8436                         
8437                                         PropertyDataMap->erase(PropertyName);
8438                                         PropertyDataMap->insert(std::make_pair(PropertyName, PropertyValue));
8439                         
8440                                 }
8441                                 
8442                         }
8443                         
8444                         //wxSPropertyPropValuesOut->Append(wxT(";"));
8445                         //wxSPropertyPropValuesOut->Append(PropertyName + wxT("=") + PropertyValue);
8446                 
8447                 }
8448                 
8449                 wxSPropertyXVCard4Value->Append(*wxSPropertySeg2Ptr);
8450                 *XVCardV4Value = TRUE;
8451                                 
8452         }
8453         
8454         // X-VCARD4-CATEGORIES
8455         
8456         if (wxSProperty == wxT("X-VCARD4-CATEGORIES")){
8457         
8458                 int intPropertyLen;
8459                 
8460                 if (ProcessItemData == TRUE){
8461         
8462                         intPropertyLen = wxSPropertySeg1Chopped.Len();          
8463                 
8464                 } else {
8465                 
8466                         intPropertyLen = wxSPropertySeg1Ptr->Len();
8467                 
8468                 }
8469                 
8470                 std::map<int, int> SplitPoints;
8471                 std::map<int, int> SplitLength;
8472                 std::map<int, int>::iterator SLiter;
8473                 std::map<wxString, bool>::iterator BIter;;                      
8474                 wxString PropertyData;
8475                 wxString PropertyName;
8476                 wxString PropertyValue;
8477                 wxString PropertyTokens;
8478                 bool AfterFirstToken = FALSE;
8479                 bool FirstToken = TRUE;                 
8480                 int intSplitsFound = 0;
8481                 int intSplitSize = 0;
8482                 int intPrevValue = 21;
8483                 int intPref = 0;
8484                 int intType = 0;
8485                 int intSplitSeek = 0;
8488                 if (ProcessItemData == TRUE){
8489                 
8490                         SplitValues(&wxSPropertySeg1Chopped, &SplitPoints, &SplitLength, intPrevValue);
8491                         
8492                 } else {
8493                         
8494                         SplitValues(wxSPropertySeg1Ptr, &SplitPoints, &SplitLength, intPrevValue);
8495                         *wxSPropertyDataNameOut = wxT("CATEGORIES");
8496                         
8497                 }
8498                 
8499                 for (std::map<int, int>::iterator intiter = SplitPoints.begin(); 
8500                 intiter != SplitPoints.end(); ++intiter){
8501                 
8502                         SLiter = SplitLength.find(intiter->first);
8503                 
8504                         if (ProcessItemData == TRUE){
8506                                 if (FirstToken == TRUE){
8507                 
8508                                         PropertyData = wxSPropertySeg1Chopped.Mid((intPrevValue - 1), (SLiter->second));
8509                                         FirstToken = FALSE;
8510                                 
8511                                 } else {
8512                                 
8513                                         PropertyData = wxSPropertySeg1Chopped.Mid((intPrevValue), (SLiter->second));
8514                                 
8515                                 }
8516                         
8517                         } else {
8518                         
8519                                 if (FirstToken == TRUE){
8520                         
8521                                         PropertyData = wxSPropertySeg1Ptr->Mid((intPrevValue - 1), (SLiter->second));
8522                                         FirstToken = FALSE;
8523                                                                 
8524                                 } else {
8525                                 
8526                                         PropertyData = wxSPropertySeg1Ptr->Mid((intPrevValue), (SLiter->second));
8527                                         
8528                                 }
8529                         
8530                         }
8531                         
8532                         wxStringTokenizer PropertyElement (PropertyData, wxT("="));
8533                         PropertyName = PropertyElement.GetNextToken();                          
8534                         PropertyValue = PropertyElement.GetNextToken();
8535                         
8536                         //ProcessCaptureStrings(&PropertyValue);
8537                         
8538                         intPrevValue = intiter->second;
8539                         
8540                         // Process properties.
8541                         
8542                         // Check if there is a lock on the property value. If there is a lock then
8543                         // the property value cannot be changed.
8544                         
8545                         if (PropertyName.IsEmpty()){
8546                         
8547                                 continue;
8548                         
8549                         }
8550                         
8551                         if (PropertyLockMap->find(PropertyName) == PropertyLockMap->end()){
8552                         
8553                                 if (PropertyDataMap->find(PropertyName) == PropertyDataMap->end()){
8554                         
8555                                         PropertyDataMap->insert(std::make_pair(PropertyName, PropertyValue));
8556                         
8557                                 } else {
8558                         
8559                                         PropertyDataMap->erase(PropertyName);
8560                                         PropertyDataMap->insert(std::make_pair(PropertyName, PropertyValue));
8561                         
8562                                 }
8563                                 
8564                         }
8565                         
8566                         //wxSPropertyPropValuesOut->Append(wxT(";"));
8567                         //wxSPropertyPropValuesOut->Append(PropertyName + wxT("=") + PropertyValue);
8568                 
8569                 }
8570                 
8571                 wxSPropertyXVCard4Value->Append(*wxSPropertySeg2Ptr);
8572                 *XVCardV4Value = TRUE;
8573                                 
8574         }
8575         
8576         // X-VCARD4-PHOTO
8577         
8578         if (wxSProperty == wxT("X-VCARD4-PHOTO")){
8579         
8580                 int intPropertyLen;
8581                 
8582                 if (ProcessItemData == TRUE){
8583         
8584                         intPropertyLen = wxSPropertySeg1Chopped.Len();          
8585                 
8586                 } else {
8587                 
8588                         intPropertyLen = wxSPropertySeg1Ptr->Len();
8589                 
8590                 }
8591                 
8592                 std::map<int, int> SplitPoints;
8593                 std::map<int, int> SplitLength;
8594                 std::map<int, int>::iterator SLiter;
8595                 std::map<wxString, bool>::iterator BIter;;                      
8596                 wxString PropertyData;
8597                 wxString PropertyName;
8598                 wxString PropertyValue;
8599                 wxString PropertyTokens;
8600                 bool AfterFirstToken = FALSE;
8601                 bool FirstToken = TRUE;                 
8602                 int intSplitsFound = 0;
8603                 int intSplitSize = 0;
8604                 int intPrevValue = 16;
8605                 int intPref = 0;
8606                 int intType = 0;
8607                 int intSplitSeek = 0;
8610                 if (ProcessItemData == TRUE){
8611                 
8612                         SplitValues(&wxSPropertySeg1Chopped, &SplitPoints, &SplitLength, intPrevValue);
8613                         
8614                 } else {
8615                         
8616                         SplitValues(wxSPropertySeg1Ptr, &SplitPoints, &SplitLength, intPrevValue);
8617                         *wxSPropertyDataNameOut = wxT("PHOTO");
8618                         
8619                 }
8620                 
8621                 for (std::map<int, int>::iterator intiter = SplitPoints.begin(); 
8622                 intiter != SplitPoints.end(); ++intiter){
8623                 
8624                         SLiter = SplitLength.find(intiter->first);
8625                 
8626                         if (ProcessItemData == TRUE){
8628                                 if (FirstToken == TRUE){
8629                 
8630                                         PropertyData = wxSPropertySeg1Chopped.Mid((intPrevValue - 1), (SLiter->second));
8631                                         FirstToken = FALSE;
8632                                 
8633                                 } else {
8634                                 
8635                                         PropertyData = wxSPropertySeg1Chopped.Mid((intPrevValue), (SLiter->second));
8636                                 
8637                                 }
8638                         
8639                         } else {
8640                         
8641                                 if (FirstToken == TRUE){
8642                         
8643                                         PropertyData = wxSPropertySeg1Ptr->Mid((intPrevValue - 1), (SLiter->second));
8644                                         FirstToken = FALSE;
8645                                                                 
8646                                 } else {
8647                                 
8648                                         PropertyData = wxSPropertySeg1Ptr->Mid((intPrevValue), (SLiter->second));
8649                                         
8650                                 }
8651                         
8652                         }
8653                         
8654                         wxStringTokenizer PropertyElement (PropertyData, wxT("="));
8655                         PropertyName = PropertyElement.GetNextToken();                          
8656                         PropertyValue = PropertyElement.GetNextToken();
8657                         
8658                         //ProcessCaptureStrings(&PropertyValue);
8659                         
8660                         intPrevValue = intiter->second;
8661                         
8662                         // Process properties.
8663                         
8664                         // Check if there is a lock on the property value. If there is a lock then
8665                         // the property value cannot be changed.
8666                         
8667                         if (PropertyName.IsEmpty()){
8668                         
8669                                 continue;
8670                         
8671                         }
8672                         
8673                         if (PropertyLockMap->find(PropertyName) == PropertyLockMap->end()){
8674                         
8675                                 if (PropertyDataMap->find(PropertyName) == PropertyDataMap->end()){
8676                         
8677                                         PropertyDataMap->insert(std::make_pair(PropertyName, PropertyValue));
8678                         
8679                                 } else {
8680                         
8681                                         PropertyDataMap->erase(PropertyName);
8682                                         PropertyDataMap->insert(std::make_pair(PropertyName, PropertyValue));
8683                         
8684                                 }
8685                                 
8686                         }
8687                         
8688                         //wxSPropertyPropValuesOut->Append(wxT(";"));
8689                         //wxSPropertyPropValuesOut->Append(PropertyName + wxT("=") + PropertyValue);
8690                 
8691                 }
8692                 
8693                 wxSPropertyXVCard4Value->Append(*wxSPropertySeg2Ptr);
8694                 *XVCardV4Value = TRUE;
8695                                 
8696         }
8697         
8698         // X-VCARD4-LOGO
8699         
8700         if (wxSProperty == wxT("X-VCARD4-LOGO")){
8701         
8702                 int intPropertyLen;
8703                 
8704                 if (ProcessItemData == TRUE){
8705         
8706                         intPropertyLen = wxSPropertySeg1Chopped.Len();          
8707                 
8708                 } else {
8709                 
8710                         intPropertyLen = wxSPropertySeg1Ptr->Len();
8711                 
8712                 }
8713                 
8714                 std::map<int, int> SplitPoints;
8715                 std::map<int, int> SplitLength;
8716                 std::map<int, int>::iterator SLiter;
8717                 std::map<wxString, bool>::iterator BIter;;                      
8718                 wxString PropertyData;
8719                 wxString PropertyName;
8720                 wxString PropertyValue;
8721                 wxString PropertyTokens;
8722                 bool AfterFirstToken = FALSE;
8723                 bool FirstToken = TRUE;                 
8724                 int intSplitsFound = 0;
8725                 int intSplitSize = 0;
8726                 int intPrevValue = 15;
8727                 int intPref = 0;
8728                 int intType = 0;
8729                 int intSplitSeek = 0;
8732                 if (ProcessItemData == TRUE){
8733                 
8734                         SplitValues(&wxSPropertySeg1Chopped, &SplitPoints, &SplitLength, intPrevValue);
8735                         
8736                 } else {
8737                         
8738                         SplitValues(wxSPropertySeg1Ptr, &SplitPoints, &SplitLength, intPrevValue);
8739                         *wxSPropertyDataNameOut = wxT("LOGO");
8740                         
8741                 }
8742                 
8743                 for (std::map<int, int>::iterator intiter = SplitPoints.begin(); 
8744                 intiter != SplitPoints.end(); ++intiter){
8745                 
8746                         SLiter = SplitLength.find(intiter->first);
8747                 
8748                         if (ProcessItemData == TRUE){
8750                                 if (FirstToken == TRUE){
8751                 
8752                                         PropertyData = wxSPropertySeg1Chopped.Mid((intPrevValue - 1), (SLiter->second));
8753                                         FirstToken = FALSE;
8754                                 
8755                                 } else {
8756                                 
8757                                         PropertyData = wxSPropertySeg1Chopped.Mid((intPrevValue), (SLiter->second));
8758                                 
8759                                 }
8760                         
8761                         } else {
8762                         
8763                                 if (FirstToken == TRUE){
8764                         
8765                                         PropertyData = wxSPropertySeg1Ptr->Mid((intPrevValue - 1), (SLiter->second));
8766                                         FirstToken = FALSE;
8767                                                                 
8768                                 } else {
8769                                 
8770                                         PropertyData = wxSPropertySeg1Ptr->Mid((intPrevValue), (SLiter->second));
8771                                         
8772                                 }
8773                         
8774                         }
8775                         
8776                         wxStringTokenizer PropertyElement (PropertyData, wxT("="));
8777                         PropertyName = PropertyElement.GetNextToken();                          
8778                         PropertyValue = PropertyElement.GetNextToken();
8779                         
8780                         //ProcessCaptureStrings(&PropertyValue);
8781                         
8782                         intPrevValue = intiter->second;
8783                         
8784                         // Process properties.
8785                         
8786                         // Check if there is a lock on the property value. If there is a lock then
8787                         // the property value cannot be changed.
8788                         
8789                         if (PropertyName.IsEmpty()){
8790                         
8791                                 continue;
8792                         
8793                         }
8794                         
8795                         if (PropertyLockMap->find(PropertyName) == PropertyLockMap->end()){
8796                         
8797                                 if (PropertyDataMap->find(PropertyName) == PropertyDataMap->end()){
8798                         
8799                                         PropertyDataMap->insert(std::make_pair(PropertyName, PropertyValue));
8800                         
8801                                 } else {
8802                         
8803                                         PropertyDataMap->erase(PropertyName);
8804                                         PropertyDataMap->insert(std::make_pair(PropertyName, PropertyValue));
8805                         
8806                                 }
8807                                 
8808                         }
8809                         
8810                         //wxSPropertyPropValuesOut->Append(wxT(";"));
8811                         //wxSPropertyPropValuesOut->Append(PropertyName + wxT("=") + PropertyValue);
8812                 
8813                 }
8814                 
8815                 wxSPropertyXVCard4Value->Append(*wxSPropertySeg2Ptr);
8816                 *XVCardV4Value = TRUE;
8817                                 
8818         }
8819         
8820         // X-VCARD4-SOUND
8821         
8822         if (wxSProperty == wxT("X-VCARD4-SOUND")){
8823         
8824                 int intPropertyLen;
8825                 
8826                 if (ProcessItemData == TRUE){
8827         
8828                         intPropertyLen = wxSPropertySeg1Chopped.Len();          
8829                 
8830                 } else {
8831                 
8832                         intPropertyLen = wxSPropertySeg1Ptr->Len();
8833                 
8834                 }
8835                 
8836                 std::map<int, int> SplitPoints;
8837                 std::map<int, int> SplitLength;
8838                 std::map<int, int>::iterator SLiter;
8839                 std::map<wxString, bool>::iterator BIter;;                      
8840                 wxString PropertyData;
8841                 wxString PropertyName;
8842                 wxString PropertyValue;
8843                 wxString PropertyTokens;
8844                 bool AfterFirstToken = FALSE;
8845                 bool FirstToken = TRUE;                 
8846                 int intSplitsFound = 0;
8847                 int intSplitSize = 0;
8848                 int intPrevValue = 16;
8849                 int intPref = 0;
8850                 int intType = 0;
8851                 int intSplitSeek = 0;
8854                 if (ProcessItemData == TRUE){
8855                 
8856                         SplitValues(&wxSPropertySeg1Chopped, &SplitPoints, &SplitLength, intPrevValue);
8857                         
8858                 } else {
8859                         
8860                         SplitValues(wxSPropertySeg1Ptr, &SplitPoints, &SplitLength, intPrevValue);
8861                         *wxSPropertyDataNameOut = wxT("SOUND");
8862                         
8863                 }
8864                 
8865                 for (std::map<int, int>::iterator intiter = SplitPoints.begin(); 
8866                 intiter != SplitPoints.end(); ++intiter){
8867                 
8868                         SLiter = SplitLength.find(intiter->first);
8869                 
8870                         if (ProcessItemData == TRUE){
8872                                 if (FirstToken == TRUE){
8873                 
8874                                         PropertyData = wxSPropertySeg1Chopped.Mid((intPrevValue - 1), (SLiter->second));
8875                                         FirstToken = FALSE;
8876                                 
8877                                 } else {
8878                                 
8879                                         PropertyData = wxSPropertySeg1Chopped.Mid((intPrevValue), (SLiter->second));
8880                                 
8881                                 }
8882                         
8883                         } else {
8884                         
8885                                 if (FirstToken == TRUE){
8886                         
8887                                         PropertyData = wxSPropertySeg1Ptr->Mid((intPrevValue - 1), (SLiter->second));
8888                                         FirstToken = FALSE;
8889                                                                 
8890                                 } else {
8891                                 
8892                                         PropertyData = wxSPropertySeg1Ptr->Mid((intPrevValue), (SLiter->second));
8893                                         
8894                                 }
8895                         
8896                         }
8897                         
8898                         wxStringTokenizer PropertyElement (PropertyData, wxT("="));
8899                         PropertyName = PropertyElement.GetNextToken();                          
8900                         PropertyValue = PropertyElement.GetNextToken();
8901                         
8902                         //ProcessCaptureStrings(&PropertyValue);
8903                         
8904                         intPrevValue = intiter->second;
8905                         
8906                         // Process properties.
8907                         
8908                         // Check if there is a lock on the property value. If there is a lock then
8909                         // the property value cannot be changed.
8910                         
8911                         if (PropertyName.IsEmpty()){
8912                         
8913                                 continue;
8914                         
8915                         }
8916                         
8917                         if (PropertyLockMap->find(PropertyName) == PropertyLockMap->end()){
8918                         
8919                                 if (PropertyDataMap->find(PropertyName) == PropertyDataMap->end()){
8920                         
8921                                         PropertyDataMap->insert(std::make_pair(PropertyName, PropertyValue));
8922                         
8923                                 } else {
8924                         
8925                                         PropertyDataMap->erase(PropertyName);
8926                                         PropertyDataMap->insert(std::make_pair(PropertyName, PropertyValue));
8927                         
8928                                 }
8929                                 
8930                         }
8931                         
8932                         //wxSPropertyPropValuesOut->Append(wxT(";"));
8933                         //wxSPropertyPropValuesOut->Append(PropertyName + wxT("=") + PropertyValue);
8934                 
8935                 }
8936                 
8937                 wxSPropertyXVCard4Value->Append(*wxSPropertySeg2Ptr);
8938                 *XVCardV4Value = TRUE;
8939                                 
8940         }
8941         
8942         // X-VCARD4-CALURI
8943         
8944         if (wxSProperty == wxT("X-VCARD4-CALURI")){
8945         
8946                 int intPropertyLen;
8947                 
8948                 if (ProcessItemData == TRUE){
8949         
8950                         intPropertyLen = wxSPropertySeg1Chopped.Len();          
8951                 
8952                 } else {
8953                 
8954                         intPropertyLen = wxSPropertySeg1Ptr->Len();
8955                 
8956                 }
8957                 
8958                 std::map<int, int> SplitPoints;
8959                 std::map<int, int> SplitLength;
8960                 std::map<int, int>::iterator SLiter;
8961                 std::map<wxString, bool>::iterator BIter;;                      
8962                 wxString PropertyData;
8963                 wxString PropertyName;
8964                 wxString PropertyValue;
8965                 wxString PropertyTokens;
8966                 bool AfterFirstToken = FALSE;
8967                 bool FirstToken = TRUE;                 
8968                 int intSplitsFound = 0;
8969                 int intSplitSize = 0;
8970                 int intPrevValue = 17;
8971                 int intPref = 0;
8972                 int intType = 0;
8973                 int intSplitSeek = 0;
8976                 if (ProcessItemData == TRUE){
8977                 
8978                         SplitValues(&wxSPropertySeg1Chopped, &SplitPoints, &SplitLength, intPrevValue);
8979                         
8980                 } else {
8981                         
8982                         SplitValues(wxSPropertySeg1Ptr, &SplitPoints, &SplitLength, intPrevValue);
8983                         *wxSPropertyDataNameOut = wxT("CALURI");
8984                         
8985                 }
8986                 
8987                 for (std::map<int, int>::iterator intiter = SplitPoints.begin(); 
8988                 intiter != SplitPoints.end(); ++intiter){
8989                 
8990                         SLiter = SplitLength.find(intiter->first);
8991                 
8992                         if (ProcessItemData == TRUE){
8994                                 if (FirstToken == TRUE){
8995                 
8996                                         PropertyData = wxSPropertySeg1Chopped.Mid((intPrevValue - 1), (SLiter->second));
8997                                         FirstToken = FALSE;
8998                                 
8999                                 } else {
9000                                 
9001                                         PropertyData = wxSPropertySeg1Chopped.Mid((intPrevValue), (SLiter->second));
9002                                 
9003                                 }
9004                         
9005                         } else {
9006                         
9007                                 if (FirstToken == TRUE){
9008                         
9009                                         PropertyData = wxSPropertySeg1Ptr->Mid((intPrevValue - 1), (SLiter->second));
9010                                         FirstToken = FALSE;
9011                                                                 
9012                                 } else {
9013                                 
9014                                         PropertyData = wxSPropertySeg1Ptr->Mid((intPrevValue), (SLiter->second));
9015                                         
9016                                 }
9017                         
9018                         }
9019                         
9020                         wxStringTokenizer PropertyElement (PropertyData, wxT("="));
9021                         PropertyName = PropertyElement.GetNextToken();                          
9022                         PropertyValue = PropertyElement.GetNextToken();
9023                         
9024                         //ProcessCaptureStrings(&PropertyValue);
9025                         
9026                         intPrevValue = intiter->second;
9027                         
9028                         // Process properties.
9029                         
9030                         // Check if there is a lock on the property value. If there is a lock then
9031                         // the property value cannot be changed.
9032                         
9033                         if (PropertyName.IsEmpty()){
9034                         
9035                                 continue;
9036                         
9037                         }
9038                         
9039                         if (PropertyLockMap->find(PropertyName) == PropertyLockMap->end()){
9040                         
9041                                 if (PropertyDataMap->find(PropertyName) == PropertyDataMap->end()){
9042                         
9043                                         PropertyDataMap->insert(std::make_pair(PropertyName, PropertyValue));
9044                         
9045                                 } else {
9046                         
9047                                         PropertyDataMap->erase(PropertyName);
9048                                         PropertyDataMap->insert(std::make_pair(PropertyName, PropertyValue));
9049                         
9050                                 }
9051                                 
9052                         }
9053                         
9054                         //wxSPropertyPropValuesOut->Append(wxT(";"));
9055                         //wxSPropertyPropValuesOut->Append(PropertyName + wxT("=") + PropertyValue);
9056                 
9057                 }
9058                 
9059                 wxSPropertyXVCard4Value->Append(*wxSPropertySeg2Ptr);
9060                 *XVCardV4Value = TRUE;
9061                                 
9062         }
9063         
9064         // X-VCARD4-CALADRURI
9065         
9066         if (wxSProperty == wxT("X-VCARD4-CALADRURI")){
9067         
9068                 int intPropertyLen;
9069                 
9070                 if (ProcessItemData == TRUE){
9071         
9072                         intPropertyLen = wxSPropertySeg1Chopped.Len();          
9073                 
9074                 } else {
9075                 
9076                         intPropertyLen = wxSPropertySeg1Ptr->Len();
9077                 
9078                 }
9079                 
9080                 std::map<int, int> SplitPoints;
9081                 std::map<int, int> SplitLength;
9082                 std::map<int, int>::iterator SLiter;
9083                 std::map<wxString, bool>::iterator BIter;;                      
9084                 wxString PropertyData;
9085                 wxString PropertyName;
9086                 wxString PropertyValue;
9087                 wxString PropertyTokens;
9088                 bool AfterFirstToken = FALSE;
9089                 bool FirstToken = TRUE;                 
9090                 int intSplitsFound = 0;
9091                 int intSplitSize = 0;
9092                 int intPrevValue = 20;
9093                 int intPref = 0;
9094                 int intType = 0;
9095                 int intSplitSeek = 0;
9098                 if (ProcessItemData == TRUE){
9099                 
9100                         SplitValues(&wxSPropertySeg1Chopped, &SplitPoints, &SplitLength, intPrevValue);
9101                         
9102                 } else {
9103                         
9104                         SplitValues(wxSPropertySeg1Ptr, &SplitPoints, &SplitLength, intPrevValue);
9105                         *wxSPropertyDataNameOut = wxT("CALADRURI");
9106                         
9107                 }
9108                 
9109                 for (std::map<int, int>::iterator intiter = SplitPoints.begin(); 
9110                 intiter != SplitPoints.end(); ++intiter){
9111                 
9112                         SLiter = SplitLength.find(intiter->first);
9113                 
9114                         if (ProcessItemData == TRUE){
9116                                 if (FirstToken == TRUE){
9117                 
9118                                         PropertyData = wxSPropertySeg1Chopped.Mid((intPrevValue - 1), (SLiter->second));
9119                                         FirstToken = FALSE;
9120                                 
9121                                 } else {
9122                                 
9123                                         PropertyData = wxSPropertySeg1Chopped.Mid((intPrevValue), (SLiter->second));
9124                                 
9125                                 }
9126                         
9127                         } else {
9128                         
9129                                 if (FirstToken == TRUE){
9130                         
9131                                         PropertyData = wxSPropertySeg1Ptr->Mid((intPrevValue - 1), (SLiter->second));
9132                                         FirstToken = FALSE;
9133                                                                 
9134                                 } else {
9135                                 
9136                                         PropertyData = wxSPropertySeg1Ptr->Mid((intPrevValue), (SLiter->second));
9137                                         
9138                                 }
9139                         
9140                         }
9141                         
9142                         wxStringTokenizer PropertyElement (PropertyData, wxT("="));
9143                         PropertyName = PropertyElement.GetNextToken();                          
9144                         PropertyValue = PropertyElement.GetNextToken();
9145                         
9146                         //ProcessCaptureStrings(&PropertyValue);
9147                         
9148                         intPrevValue = intiter->second;
9149                         
9150                         // Process properties.
9151                         
9152                         // Check if there is a lock on the property value. If there is a lock then
9153                         // the property value cannot be changed.
9154                         
9155                         if (PropertyName.IsEmpty()){
9156                         
9157                                 continue;
9158                         
9159                         }
9160                         
9161                         if (PropertyLockMap->find(PropertyName) == PropertyLockMap->end()){
9162                         
9163                                 if (PropertyDataMap->find(PropertyName) == PropertyDataMap->end()){
9164                         
9165                                         PropertyDataMap->insert(std::make_pair(PropertyName, PropertyValue));
9166                         
9167                                 } else {
9168                         
9169                                         PropertyDataMap->erase(PropertyName);
9170                                         PropertyDataMap->insert(std::make_pair(PropertyName, PropertyValue));
9171                         
9172                                 }
9173                                 
9174                         }
9175                         
9176                         //wxSPropertyPropValuesOut->Append(wxT(";"));
9177                         //wxSPropertyPropValuesOut->Append(PropertyName + wxT("=") + PropertyValue);
9178                 
9179                 }
9180                 
9181                 wxSPropertyXVCard4Value->Append(*wxSPropertySeg2Ptr);
9182                 *XVCardV4Value = TRUE;
9183                                 
9184         }
9185         
9186         // X-VCARD4-FBURL
9187         
9188         if (wxSProperty == wxT("X-VCARD4-FBURL")){
9189         
9190                 int intPropertyLen;
9191                 
9192                 if (ProcessItemData == TRUE){
9193         
9194                         intPropertyLen = wxSPropertySeg1Chopped.Len();          
9195                 
9196                 } else {
9197                 
9198                         intPropertyLen = wxSPropertySeg1Ptr->Len();
9199                 
9200                 }
9201                 
9202                 std::map<int, int> SplitPoints;
9203                 std::map<int, int> SplitLength;
9204                 std::map<int, int>::iterator SLiter;
9205                 std::map<wxString, bool>::iterator BIter;;                      
9206                 wxString PropertyData;
9207                 wxString PropertyName;
9208                 wxString PropertyValue;
9209                 wxString PropertyTokens;
9210                 bool AfterFirstToken = FALSE;
9211                 bool FirstToken = TRUE;                 
9212                 int intSplitsFound = 0;
9213                 int intSplitSize = 0;
9214                 int intPrevValue = 16;
9215                 int intPref = 0;
9216                 int intType = 0;
9217                 int intSplitSeek = 0;
9220                 if (ProcessItemData == TRUE){
9221                 
9222                         SplitValues(&wxSPropertySeg1Chopped, &SplitPoints, &SplitLength, intPrevValue);
9223                         
9224                 } else {
9225                         
9226                         SplitValues(wxSPropertySeg1Ptr, &SplitPoints, &SplitLength, intPrevValue);
9227                         *wxSPropertyDataNameOut = wxT("FBURL");
9228                         
9229                 }
9230                 
9231                 for (std::map<int, int>::iterator intiter = SplitPoints.begin(); 
9232                 intiter != SplitPoints.end(); ++intiter){
9233                 
9234                         SLiter = SplitLength.find(intiter->first);
9235                 
9236                         if (ProcessItemData == TRUE){
9238                                 if (FirstToken == TRUE){
9239                 
9240                                         PropertyData = wxSPropertySeg1Chopped.Mid((intPrevValue - 1), (SLiter->second));
9241                                         FirstToken = FALSE;
9242                                 
9243                                 } else {
9244                                 
9245                                         PropertyData = wxSPropertySeg1Chopped.Mid((intPrevValue), (SLiter->second));
9246                                 
9247                                 }
9248                         
9249                         } else {
9250                         
9251                                 if (FirstToken == TRUE){
9252                         
9253                                         PropertyData = wxSPropertySeg1Ptr->Mid((intPrevValue - 1), (SLiter->second));
9254                                         FirstToken = FALSE;
9255                                                                 
9256                                 } else {
9257                                 
9258                                         PropertyData = wxSPropertySeg1Ptr->Mid((intPrevValue), (SLiter->second));
9259                                         
9260                                 }
9261                         
9262                         }
9263                         
9264                         wxStringTokenizer PropertyElement (PropertyData, wxT("="));
9265                         PropertyName = PropertyElement.GetNextToken();                          
9266                         PropertyValue = PropertyElement.GetNextToken();
9267                         
9268                         //ProcessCaptureStrings(&PropertyValue);
9269                         
9270                         intPrevValue = intiter->second;
9271                         
9272                         // Process properties.
9273                         
9274                         // Check if there is a lock on the property value. If there is a lock then
9275                         // the property value cannot be changed.
9276                         
9277                         if (PropertyName.IsEmpty()){
9278                         
9279                                 continue;
9280                         
9281                         }
9282                         
9283                         if (PropertyLockMap->find(PropertyName) == PropertyLockMap->end()){
9284                         
9285                                 if (PropertyDataMap->find(PropertyName) == PropertyDataMap->end()){
9286                         
9287                                         PropertyDataMap->insert(std::make_pair(PropertyName, PropertyValue));
9288                         
9289                                 } else {
9290                         
9291                                         PropertyDataMap->erase(PropertyName);
9292                                         PropertyDataMap->insert(std::make_pair(PropertyName, PropertyValue));
9293                         
9294                                 }
9295                                 
9296                         }
9297                         
9298                         //wxSPropertyPropValuesOut->Append(wxT(";"));
9299                         //wxSPropertyPropValuesOut->Append(PropertyName + wxT("=") + PropertyValue);
9300                 
9301                 }
9302                 
9303                 wxSPropertyXVCard4Value->Append(*wxSPropertySeg2Ptr);
9304                 *XVCardV4Value = TRUE;
9305                                 
9306         }
9307         
9308         // X-VCARD4-KEY
9309         
9310         if (wxSProperty == wxT("X-VCARD4-KEY")){
9311         
9312                 int intPropertyLen;
9313                 
9314                 if (ProcessItemData == TRUE){
9315         
9316                         intPropertyLen = wxSPropertySeg1Chopped.Len();          
9317                 
9318                 } else {
9319                 
9320                         intPropertyLen = wxSPropertySeg1Ptr->Len();
9321                 
9322                 }
9323                 
9324                 std::map<int, int> SplitPoints;
9325                 std::map<int, int> SplitLength;
9326                 std::map<int, int>::iterator SLiter;
9327                 std::map<wxString, bool>::iterator BIter;;                      
9328                 wxString PropertyData;
9329                 wxString PropertyName;
9330                 wxString PropertyValue;
9331                 wxString PropertyTokens;
9332                 bool AfterFirstToken = FALSE;
9333                 bool FirstToken = TRUE;                 
9334                 int intSplitsFound = 0;
9335                 int intSplitSize = 0;
9336                 int intPrevValue = 14;
9337                 int intPref = 0;
9338                 int intType = 0;
9339                 int intSplitSeek = 0;
9342                 if (ProcessItemData == TRUE){
9343                 
9344                         SplitValues(&wxSPropertySeg1Chopped, &SplitPoints, &SplitLength, intPrevValue);
9345                         
9346                 } else {
9347                         
9348                         SplitValues(wxSPropertySeg1Ptr, &SplitPoints, &SplitLength, intPrevValue);
9349                         *wxSPropertyDataNameOut = wxT("KEY");
9350                         
9351                 }
9352                 
9353                 for (std::map<int, int>::iterator intiter = SplitPoints.begin(); 
9354                 intiter != SplitPoints.end(); ++intiter){
9355                 
9356                         SLiter = SplitLength.find(intiter->first);
9357                 
9358                         if (ProcessItemData == TRUE){
9360                                 if (FirstToken == TRUE){
9361                 
9362                                         PropertyData = wxSPropertySeg1Chopped.Mid((intPrevValue - 1), (SLiter->second));
9363                                         FirstToken = FALSE;
9364                                 
9365                                 } else {
9366                                 
9367                                         PropertyData = wxSPropertySeg1Chopped.Mid((intPrevValue), (SLiter->second));
9368                                 
9369                                 }
9370                         
9371                         } else {
9372                         
9373                                 if (FirstToken == TRUE){
9374                         
9375                                         PropertyData = wxSPropertySeg1Ptr->Mid((intPrevValue - 1), (SLiter->second));
9376                                         FirstToken = FALSE;
9377                                                                 
9378                                 } else {
9379                                 
9380                                         PropertyData = wxSPropertySeg1Ptr->Mid((intPrevValue), (SLiter->second));
9381                                         
9382                                 }
9383                         
9384                         }
9385                         
9386                         wxStringTokenizer PropertyElement (PropertyData, wxT("="));
9387                         PropertyName = PropertyElement.GetNextToken();                          
9388                         PropertyValue = PropertyElement.GetNextToken();
9389                 
9390                         //ProcessCaptureStrings(&PropertyValue);
9391                         
9392                         intPrevValue = intiter->second;
9393                         
9394                         // Process properties.
9395                         
9396                         // Check if there is a lock on the property value. If there is a lock then
9397                         // the property value cannot be changed.
9398                         
9399                         if (PropertyName.IsEmpty()){
9400                         
9401                                 continue;
9402                         
9403                         }
9404                         
9405                         if (PropertyLockMap->find(PropertyName) == PropertyLockMap->end()){
9406                         
9407                                 if (PropertyDataMap->find(PropertyName) == PropertyDataMap->end()){
9408                         
9409                                         PropertyDataMap->insert(std::make_pair(PropertyName, PropertyValue));
9410                         
9411                                 } else {
9412                         
9413                                         PropertyDataMap->erase(PropertyName);
9414                                         PropertyDataMap->insert(std::make_pair(PropertyName, PropertyValue));
9415                         
9416                                 }
9417                                 
9418                         }
9419                         
9420                         //wxSPropertyPropValuesOut->Append(wxT(";"));
9421                         //wxSPropertyPropValuesOut->Append(PropertyName + wxT("=") + PropertyValue);
9422                 
9423                 }
9424                 
9425                 wxSPropertyXVCard4Value->Append(*wxSPropertySeg2Ptr);
9426                 *XVCardV4Value = TRUE;
9427                                 
9428         }
9429         
9430         // X-VCARD4-VND-*
9431         
9432         if (wxSProperty.Mid(0, 12) == wxT("X-VCARD4-VND")){
9433         
9434                 int intPropertyLen;
9435                 
9436                 if (ProcessItemData == TRUE){
9437         
9438                         intPropertyLen = wxSPropertySeg1Chopped.Len();          
9439                 
9440                 } else {
9441                 
9442                         intPropertyLen = wxSPropertySeg1Ptr->Len();
9443                 
9444                 }
9445                 
9446                 std::map<int, int> SplitPoints;
9447                 std::map<int, int> SplitLength;
9448                 std::map<int, int>::iterator SLiter;
9449                 std::map<wxString, bool>::iterator BIter;;                      
9450                 wxString PropertyData;
9451                 wxString PropertyName;
9452                 wxString PropertyValue;
9453                 wxString PropertyTokens;
9454                 bool AfterFirstToken = FALSE;
9455                 bool FirstToken = TRUE;                 
9456                 int intSplitsFound = 0;
9457                 int intSplitSize = 0;
9458                 int intPrevValue = 14;
9459                 int intPref = 0;
9460                 int intType = 0;
9461                 int intSplitSeek = 0;
9464                 if (ProcessItemData == TRUE){
9465                 
9466                         SplitValues(&wxSPropertySeg1Chopped, &SplitPoints, &SplitLength, intPrevValue);
9467                         
9468                 } else {
9469                         
9470                         SplitValues(wxSPropertySeg1Ptr, &SplitPoints, &SplitLength, intPrevValue);
9471                         *wxSPropertyDataNameOut = wxSProperty.Mid(9);
9472                         
9473                 }
9474                 
9475                 for (std::map<int, int>::iterator intiter = SplitPoints.begin(); 
9476                 intiter != SplitPoints.end(); ++intiter){
9477                 
9478                         SLiter = SplitLength.find(intiter->first);
9479                 
9480                         if (ProcessItemData == TRUE){
9482                                 if (FirstToken == TRUE){
9483                 
9484                                         PropertyData = wxSPropertySeg1Chopped.Mid((intPrevValue - 1), (SLiter->second));
9485                                         FirstToken = FALSE;
9486                                 
9487                                 } else {
9488                                 
9489                                         PropertyData = wxSPropertySeg1Chopped.Mid((intPrevValue), (SLiter->second));
9490                                 
9491                                 }
9492                         
9493                         } else {
9494                         
9495                                 if (FirstToken == TRUE){
9496                         
9497                                         PropertyData = wxSPropertySeg1Ptr->Mid((intPrevValue - 1), (SLiter->second));
9498                                         FirstToken = FALSE;
9499                                                                 
9500                                 } else {
9501                                 
9502                                         PropertyData = wxSPropertySeg1Ptr->Mid((intPrevValue), (SLiter->second));
9503                                         
9504                                 }
9505                         
9506                         }
9507                         
9508                         wxStringTokenizer PropertyElement (PropertyData, wxT("="));
9509                         PropertyName = PropertyElement.GetNextToken();                          
9510                         PropertyValue = PropertyElement.GetNextToken();
9511                         
9512                         //ProcessCaptureStrings(&PropertyValue);
9513                         
9514                         intPrevValue = intiter->second;
9515                         
9516                         // Process properties.
9517                         
9518                         // Check if there is a lock on the property value. If there is a lock then
9519                         // the property value cannot be changed.
9520                         
9521                         if (PropertyName.IsEmpty()){
9522                         
9523                                 continue;
9524                         
9525                         }
9526                         
9527                         if (PropertyLockMap->find(PropertyName) == PropertyLockMap->end()){
9528                         
9529                                 if (PropertyDataMap->find(PropertyName) == PropertyDataMap->end()){
9530                         
9531                                         PropertyDataMap->insert(std::make_pair(PropertyName, PropertyValue));
9532                         
9533                                 } else {
9534                         
9535                                         PropertyDataMap->erase(PropertyName);
9536                                         PropertyDataMap->insert(std::make_pair(PropertyName, PropertyValue));
9537                         
9538                                 }
9539                                 
9540                         }
9541                         
9542                         //wxSPropertyPropValuesOut->Append(wxT(";"));
9543                         //wxSPropertyPropValuesOut->Append(PropertyName + wxT("=") + PropertyValue);
9544                 
9545                 }
9546                 
9547                 wxSPropertyXVCard4Value->Append(*wxSPropertySeg2Ptr);
9548                 *XVCardV4Value = TRUE;          
9549         
9550         }
9551         
9552         // X-ADDRESSBOOKSERVER-KIND
9553         
9554         if (wxSProperty == wxT("X-ADDRESSBOOKSERVER-KIND")){
9555                 
9556                 // Process Data.
9557                 
9558                 int intPropertyLen;
9559                 
9560                 if (ProcessItemData == TRUE){
9561         
9562                         intPropertyLen = wxSPropertySeg1Chopped.Len();          
9563                 
9564                 } else {
9565                 
9566                         intPropertyLen = wxSPropertySeg1Ptr->Len();
9567                 
9568                 }
9569                 
9570                 std::map<int, int> SplitPoints;
9571                 std::map<int, int> SplitLength;
9572                 std::map<int, int>::iterator SLiter;
9573                 std::map<wxString, bool>::iterator BIter;;                      
9574                 wxString PropertyData;
9575                 wxString PropertyName;
9576                 wxString PropertyValue;
9577                 wxString PropertyTokens;
9578                 bool AfterFirstToken = FALSE;
9579                 bool FirstToken = TRUE;                 
9580                 int intSplitsFound = 0;
9581                 int intSplitSize = 0;
9582                 int intPrevValue = 26;
9583                 int intPref = 0;
9584                 int intType = 0;
9585                 int intSplitSeek = 0;
9588                 if (ProcessItemData == TRUE){
9589                 
9590                         SplitValues(&wxSPropertySeg1Chopped, &SplitPoints, &SplitLength, intPrevValue);
9591                         
9592                 } else {
9593                         
9594                         SplitValues(wxSPropertySeg1Ptr, &SplitPoints, &SplitLength, intPrevValue);
9595                         
9596                 }
9597                 
9598                 *wxSPropertyDataNameOut = wxT("KIND");
9599                 
9600                 for (std::map<int, int>::iterator intiter = SplitPoints.begin(); 
9601                 intiter != SplitPoints.end(); ++intiter){
9602                 
9603                         SLiter = SplitLength.find(intiter->first);
9604                 
9605                         if (ProcessItemData == TRUE){
9607                                 if (FirstToken == TRUE){
9608                 
9609                                         PropertyData = wxSPropertySeg1Chopped.Mid((intPrevValue - 1), (SLiter->second));
9610                                         FirstToken = FALSE;
9611                                 
9612                                 } else {
9613                                 
9614                                         PropertyData = wxSPropertySeg1Chopped.Mid((intPrevValue), (SLiter->second));
9615                                 
9616                                 }
9617                         
9618                         } else {
9619                         
9620                                 if (FirstToken == TRUE){
9621                         
9622                                         PropertyData = wxSPropertySeg1Ptr->Mid((intPrevValue - 1), (SLiter->second));
9623                                         FirstToken = FALSE;
9624                                                                 
9625                                 } else {
9626                                 
9627                                         PropertyData = wxSPropertySeg1Ptr->Mid((intPrevValue), (SLiter->second));
9628                                         
9629                                 }
9630                         
9631                         }
9632                         
9633                         wxStringTokenizer PropertyElement (PropertyData, wxT("="));
9634                         PropertyName = PropertyElement.GetNextToken();                          
9635                         PropertyValue = PropertyElement.GetNextToken();
9636                         
9637                         //ProcessCaptureStrings(&PropertyValue);
9638                         
9639                         intPrevValue = intiter->second;
9640                         
9641                         // Process properties.
9642                         
9643                         // Check if there is a lock on the property value. If there is a lock then
9644                         // the property value cannot be changed.
9645                         
9646                         if (PropertyName.IsEmpty()){
9647                         
9648                                 continue;
9649                         
9650                         }
9651                         
9652                         if (PropertyLockMap->find(PropertyName) == PropertyLockMap->end()){
9653                         
9654                                 if (PropertyDataMap->find(PropertyName) == PropertyDataMap->end()){
9655                         
9656                                         PropertyDataMap->insert(std::make_pair(PropertyName, PropertyValue));
9657                         
9658                                 } else {
9659                         
9660                                         PropertyDataMap->erase(PropertyName);
9661                                         PropertyDataMap->insert(std::make_pair(PropertyName, PropertyValue));
9662                         
9663                                 }
9664                                 
9665                         }
9666                         
9667                         //wxSPropertyPropValuesOut->Append(wxT(";"));
9668                         //wxSPropertyPropValuesOut->Append(PropertyName + wxT("=") + PropertyValue);
9669                 
9670                 }
9671                 
9672                 wxSPropertyXVCard4Value->Append(*wxSPropertySeg2Ptr);
9673                 *XVCardV4Value = TRUE;
9674                 
9675         }
9676         
9677         // X-ADDRESSBOOKSERVER-MEMBER
9678         
9679         if (wxSProperty == wxT("X-ADDRESSBOOKSERVER-MEMBER")){
9680                 
9681                 // Process Data.
9682                 
9683                 int intPropertyLen;
9684                 
9685                 if (ProcessItemData == TRUE){
9686         
9687                         intPropertyLen = wxSPropertySeg1Chopped.Len();          
9688                 
9689                 } else {
9690                 
9691                         intPropertyLen = wxSPropertySeg1Ptr->Len();
9692                 
9693                 }
9694                 
9695                 std::map<int, int> SplitPoints;
9696                 std::map<int, int> SplitLength;
9697                 std::map<int, int>::iterator SLiter;
9698                 std::map<wxString, bool>::iterator BIter;;                      
9699                 wxString PropertyData;
9700                 wxString PropertyName;
9701                 wxString PropertyValue;
9702                 wxString PropertyTokens;
9703                 bool AfterFirstToken = FALSE;
9704                 bool FirstToken = TRUE;                 
9705                 int intSplitsFound = 0;
9706                 int intSplitSize = 0;
9707                 int intPrevValue = 28;
9708                 int intPref = 0;
9709                 int intType = 0;
9710                 int intSplitSeek = 0;
9713                 if (ProcessItemData == TRUE){
9714                 
9715                         SplitValues(&wxSPropertySeg1Chopped, &SplitPoints, &SplitLength, intPrevValue);
9716                         
9717                 } else {
9718                         
9719                         SplitValues(wxSPropertySeg1Ptr, &SplitPoints, &SplitLength, intPrevValue);
9720                         
9721                 }
9722                 
9723                 *wxSPropertyDataNameOut = wxT("MEMBER");
9724                 
9725                 for (std::map<int, int>::iterator intiter = SplitPoints.begin(); 
9726                 intiter != SplitPoints.end(); ++intiter){
9727                 
9728                         SLiter = SplitLength.find(intiter->first);
9729                 
9730                         if (ProcessItemData == TRUE){
9732                                 if (FirstToken == TRUE){
9733                 
9734                                         PropertyData = wxSPropertySeg1Chopped.Mid((intPrevValue - 1), (SLiter->second));
9735                                         FirstToken = FALSE;
9736                                 
9737                                 } else {
9738                                 
9739                                         PropertyData = wxSPropertySeg1Chopped.Mid((intPrevValue), (SLiter->second));
9740                                 
9741                                 }
9742                         
9743                         } else {
9744                         
9745                                 if (FirstToken == TRUE){
9746                         
9747                                         PropertyData = wxSPropertySeg1Ptr->Mid((intPrevValue - 1), (SLiter->second));
9748                                         FirstToken = FALSE;
9749                                                                 
9750                                 } else {
9751                                 
9752                                         PropertyData = wxSPropertySeg1Ptr->Mid((intPrevValue), (SLiter->second));
9753                                         
9754                                 }
9755                         
9756                         }
9757                         
9758                         wxStringTokenizer PropertyElement (PropertyData, wxT("="));
9759                         PropertyName = PropertyElement.GetNextToken();                          
9760                         PropertyValue = PropertyElement.GetNextToken();
9761                         
9762                         //ProcessCaptureStrings(&PropertyValue);
9763                         
9764                         intPrevValue = intiter->second;
9765                         
9766                         // Process properties.
9767                         
9768                         // Check if there is a lock on the property value. If there is a lock then
9769                         // the property value cannot be changed.
9770                         
9771                         if (PropertyName.IsEmpty()){
9772                         
9773                                 continue;
9774                         
9775                         }
9776                         
9777                         if (PropertyLockMap->find(PropertyName) == PropertyLockMap->end()){
9778                         
9779                                 if (PropertyDataMap->find(PropertyName) == PropertyDataMap->end()){
9780                         
9781                                         PropertyDataMap->insert(std::make_pair(PropertyName, PropertyValue));
9782                         
9783                                 } else {
9784                         
9785                                         PropertyDataMap->erase(PropertyName);
9786                                         PropertyDataMap->insert(std::make_pair(PropertyName, PropertyValue));
9787                         
9788                                 }
9789                                 
9790                         }
9791                         
9792                         //wxSPropertyPropValuesOut->Append(wxT(";"));
9793                         //wxSPropertyPropValuesOut->Append(PropertyName + wxT("=") + PropertyValue);
9794                 
9795                 }
9796                 
9797                 wxSPropertyXVCard4Value->Append(*wxSPropertySeg2Ptr);
9798                 *XVCardV4Value = TRUE;
9799                 
9800                 
9801         }
9802         
9803         // Deal with X-ABLabel specifically.
9804         
9805         if (wxSProperty == wxT("X-ABLabel") && ProcessItemData == TRUE){
9806         
9807                 int intPropertyLen = wxSPropertySeg1Ptr->Len();
9808                 std::map<int, int> SplitPoints;
9809                 std::map<int, int> SplitLength;
9810                 std::map<int, int>::iterator SLiter;                    
9811                 wxString PropertyData;
9812                 wxString PropertyName;
9813                 wxString PropertyValue;
9814                 wxString PropertyTokens;
9815                 bool AfterFirstToken = FALSE;
9816                 bool FirstToken = TRUE;                 
9817                 int intSplitsFound = 0;
9818                 int intSplitSize = 0;
9819                 int intPrevValue = 11;
9820                 int intPref = 0;
9821                 int intType = 0;
9822                 int intSplitSeek = 0;
9824                 
9825                 SplitValues(wxSPropertySeg1Ptr, &SplitPoints, &SplitLength, intPrevValue);
9826                 
9827                 //EscapeString(wxSPropertySeg2Ptr, FALSE);
9828                 PropertyDataMap->insert(std::make_pair(wxT("X-ABLabel"), *wxSPropertySeg2Ptr));
9829                                 
9830         }
9834 void vCard34Conv::ProcessCaptureStringsProc(wxString *strCapture){
9836     CaptureString(strCapture, FALSE);
9840 void vCard34Conv::SplitValues(wxString *PropertyLine, 
9841         std::map<int,int> *SplitPoints, 
9842         std::map<int,int> *SplitLength, 
9843         int intSize){
9844         
9845         int intPropertyLen = PropertyLine->Len();               
9846         int intSplitsFound = 0;
9847         int intSplitSize = 0;
9848         int intSplitSeek = 0;
9849         
9850         for (int i = intSize; i <= intPropertyLen; i++){
9852                 intSplitSize++;
9853         
9854                 if (PropertyLine->Mid(i, 1) == wxT(";") &&
9855                     PropertyLine->Mid((i - 1), 1) != wxT("\\")){
9856            
9857                     if (intSplitsFound == 0){
9858             
9859                         SplitLength->insert(std::make_pair(intSplitsFound, (intSplitSize)));
9860           
9861                     } else {
9862            
9863                         SplitLength->insert(std::make_pair(intSplitsFound, (intSplitSize - 1)));
9864             
9865                     }
9866             
9867                     SplitPoints->insert(std::make_pair(intSplitsFound, (i + 1)));
9868             
9869                     intSplitsFound++;
9870                     intSplitSeek = i;
9871                     intSplitSize = 0;
9872             
9873                 }
9875         }
9877         if (intSplitsFound == 0){
9879                 SplitPoints->insert(std::make_pair(intSplitsFound, (8 + 1)));
9880                 SplitLength->insert(std::make_pair(intSplitsFound, intSplitSize));
9882         } else {
9884                 SplitPoints->insert(std::make_pair(intSplitsFound, (intSplitSeek + 1)));
9885                 SplitLength->insert(std::make_pair(intSplitsFound, intSplitSize));
9887         }
9891 void vCard34Conv::SplitValuesData(wxString *PropertyLine, 
9892         std::map<int,int> *SplitPoints, 
9893         std::map<int,int> *SplitLength, 
9894         int intSize,
9895         std::map<wxString,wxString> *SplitData){
9896         
9897         wxString DataStr;
9898         wxStringTokenizer PropertyElement;
9899         wxString PropertyName;
9900         wxString PropertyValue;
9901         int intPropertyLen = PropertyLine->Len();               
9902         int intSplitsFound = 0;
9903         int intSplitSize = 0;
9904         int intSplitSeek = (intSize - 1);
9905         
9906         for (int i = intSize; i <= intPropertyLen; i++){
9908                 intSplitSize++;
9909         
9910                 if (PropertyLine->Mid(i, 1) == wxT(";") &&
9911                     PropertyLine->Mid((i - 1), 1) != wxT("\\")){
9912            
9913                     if (intSplitsFound == 0){
9914             
9915                                 DataStr = PropertyLine->Mid(intSplitSeek, (intSplitSize));
9916                                 SplitLength->insert(std::make_pair(intSplitsFound, (intSplitSize)));
9917           
9918                         } else {
9920                                 DataStr = PropertyLine->Mid(intSplitSeek, (intSplitSize - 1));
9921                                 SplitLength->insert(std::make_pair(intSplitsFound, (intSplitSize - 1)));
9923                         }
9924                     
9925                     SplitPoints->insert(std::make_pair(intSplitsFound, (i + 1)));
9926             
9927                     intSplitsFound++;
9928                     intSplitSeek = (i + 1);
9929                     intSplitSize = 0;
9930                     
9931                     if (!DataStr.IsEmpty()){
9932                     
9933                         PropertyElement.SetString(DataStr, wxT("="));
9934                         PropertyName = PropertyElement.GetNextToken();
9935                         PropertyValue = PropertyElement.GetNextToken();
9936                         SplitData->insert(std::make_pair(PropertyName, PropertyValue));
9937                     
9938                     }
9939                     
9940                     DataStr.clear();
9941                     PropertyName.clear();
9942                     PropertyValue.clear();
9943             
9944                 }
9946         }
9948         if (intSplitsFound == 0){
9950                 DataStr = PropertyLine->Mid(intSplitSeek, (intSplitSize));
9952                 SplitPoints->insert(std::make_pair(intSplitsFound, (8 + 1)));
9953                 SplitLength->insert(std::make_pair(intSplitsFound, intSplitSize));
9955         } else {
9956                 
9957                 DataStr = PropertyLine->Mid(intSplitSeek, (intSplitSize - 1));
9959                 SplitPoints->insert(std::make_pair(intSplitsFound, (intSplitSeek + 1)));
9960                 SplitLength->insert(std::make_pair(intSplitsFound, intSplitSize));
9962         }
9964         if (!DataStr.IsEmpty()){
9965                 
9966                 PropertyElement.SetString(DataStr, wxT("="));
9967                 PropertyName = PropertyElement.GetNextToken();
9968                 PropertyValue = PropertyElement.GetNextToken();
9969                 SplitData->insert(std::make_pair(PropertyName, PropertyValue));         
9970                 
9971         }
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