4 #include "../vcard/vcard.h"
5 #include "import-struct.h"
7 std::map<int,ImportDataContact> ImportVCard4(wxArrayString *FileListInc){
9 std::map<int,ImportDataContact> FinalData;
11 // Go through each of the file names, load them up and collect the
12 // contact information.
14 std::map<int,wxString>* CardData;
16 for (int i = 0; i < FileListInc->GetCount(); i++){
20 ContactData.LoadFile(FileListInc->Item(i));
22 CardData = ContactData.GetAllCards();
25 for(std::map<int,wxString>::iterator iter = CardData->begin();
26 iter != CardData->end();
29 // Check if contact really is a vCard 4.0 contact.
32 ContactCheck.LoadString(iter->second);
34 wxString ContactVer = ContactCheck.Get(wxT("VERSION"));
36 if (ContactVer != wxT("4.0")){
42 // If contact is vCard 4.0 then continue otherwise
43 // go to the next contact.
45 ImportDataContact SelectedContact;
46 SelectedContact.Filename = FileListInc->Item(i);
47 SelectedContact.FilenameIndex = FileIndex;
48 SelectedContact.ContactData = iter->second;
49 SelectedContact.UIDValue = ContactCheck.Get(wxT("UID"));
51 FinalData.insert(std::make_pair(FileIndex, SelectedContact));