4 #include "../vcard/vcard.h"
5 #include "../vcard/vcard34conv.h"
6 #include "import-struct.h"
8 std::map<int,ImportDataContact> ImportVCard3(wxArrayString *FileListInc){
10 std::map<int,ImportDataContact> FinalData;
12 // Go through each of the file names, load them up and collect the
13 // contact information.
15 std::map<int,wxString>* CardData;
17 for (int i = 0; i < FileListInc->GetCount(); i++){
21 ContactData.LoadFile(FileListInc->Item(i));
23 CardData = ContactData.GetAllCards();
26 for(std::map<int,wxString>::iterator iter = CardData->begin();
27 iter != CardData->end();
30 // Check if contact really is a vCard 4.0 contact.
33 ContactCheck.LoadString(iter->second);
35 wxString ContactVer = ContactCheck.Get(wxT("VERSION"));
37 if (ContactVer != wxT("3.0")){
43 wxString ContactDatav3;
46 vCard34Conv vCardConvObj;
47 vCardConvObj.ConvertToV4(&ContactDatav3, &ContactDatav4);
49 // Convert data from vCard 3.0 to vCard 4.0
51 ImportDataContact SelectedContact;
52 SelectedContact.Filename = FileListInc->Item(i);
53 SelectedContact.FilenameIndex = FileIndex;
54 SelectedContact.ContactData = ContactDatav4.WriteString();
55 SelectedContact.UIDValue = ContactDatav4.Get(wxT("UID"));