&CategoriesListType, &CategoriesListPref,
&CategoriesListTokens, SaveData);
+ // Process PHOTO.
+
+ SavePhoto(&PicturesList, &PicturesListAltID,
+ &PicturesListPID, &PicturesListType,
+ &PicturesListPicEncType, &PicturesListPictureType,
+ &PicturesListMediatype, &PicturesListPref,
+ &PicturesListTokens, SaveData);
+
+ // Process LOGO.
+
+ // Process SOUND.
+
// Write the end part of the vCard data file.
SaveData->Append("END:VCARD");
}
+}
+
+void ContactDataObject::SavePhoto(map<int, string> *PicturesList, map<int, wxString> *PicturesListAltID,
+ map<int, wxString> *PicturesListPID, map<int, wxString> *PicturesListType,
+ map<int, wxString> *PicturesListPicEncType, map<int, wxString> *PicturesListPictureType,
+ map<int, wxString> *PicturesListMediatype, map<int, int> *PicturesListPref,
+ map<int, wxString> *PicturesListTokens, wxString *SaveData){
+
+ wxString ProcessData = "";
+
+ for (std::map<int, string>::iterator PicturesIter = PicturesList->begin();
+ PicturesIter != PicturesList->end(); PicturesIter++){
+
+ ProcessData.Append("PHOTO");
+
+ // Check if there is a value for TYPE.
+
+ if ((*PicturesListType)[PicturesIter->first].size() > 0){
+
+ ProcessData.Append(";TYPE=");
+ ProcessData.Append((*PicturesListType)[PicturesIter->first]);
+
+ }
+
+ // Check if there is a value for ALTID.
+
+ if ((*PicturesListAltID)[PicturesIter->first].size() > 0){
+
+ ProcessData.Append(";ALTID=");
+ ProcessData.Append((*PicturesListAltID)[PicturesIter->first]);
+
+ }
+
+ // Check if there is a value for MEDIATYPE..
+
+ if ((*PicturesListMediatype)[PicturesIter->first].size() > 0){
+
+ ProcessData.Append(";MEDIATYPE=");
+ ProcessData.Append((*PicturesListMediatype)[PicturesIter->first]);
+
+ }
+
+ // Check if there is a value for PID.
+
+ if ((*PicturesListPID)[PicturesIter->first].size() > 0){
+
+ ProcessData.Append(";PID=");
+ ProcessData.Append((*PicturesListPID)[PicturesIter->first]);
+
+ }
+
+ // Check if there is a value for PREF.
+
+ if ((*PicturesListPref)[PicturesIter->first] > 0){
+
+ ProcessData.Append(";PREF=");
+ ProcessData.Append(wxString::Format("%i", (*PicturesListPref)[PicturesIter->first]));
+
+ }
+
+ // Check if there is a value for tokens.
+
+ if ((*PicturesListTokens)[PicturesIter->first].size() > 0){
+
+ ProcessData.Append(";");
+ ProcessData.Append((*PicturesListTokens)[PicturesIter->first]);
+
+ }
+
+ ProcessData.Append(":data:");
+ ProcessData.Append((*PicturesListPictureType)[PicturesIter->first]);
+ ProcessData.Append(";");
+ ProcessData.Append((*PicturesListPicEncType)[PicturesIter->first]);
+ ProcessData.Append(",");
+ ProcessData.Append(PicturesIter->second);
+ ProcessData.Append("\n");
+
+ ProcessData = OutputText(&ProcessData);
+
+ SaveData->Append(ProcessData);
+ ProcessData.clear();
+
+ }
+
}
\ No newline at end of file
map<int, wxString> *CategoryListAltID, map<int, wxString> *CategoryListPID,
map<int, wxString> *CategoryListType, map<int, int> *CategoryListPref,
map<int, wxString> *CategoryListTokens, wxString *SaveData);
+ void SavePhoto(map<int, string> *PicturesList, map<int, wxString> *PicturesListAltID,
+ map<int, wxString> *PicturesListPID, map<int, wxString> *PicturesListType,
+ map<int, wxString> *PicturesListPicEncType, map<int, wxString> *PicturesListPictureType,
+ map<int, wxString> *PicturesListMediatype, map<int, int> *PicturesListPref,
+ map<int, wxString> *PicturesListTokens, wxString *SaveData);
public:
"CATEGORIES;TYPE=work;ALTID=84;LANGUAGE=kw;PID=86;PREF=88;AAA=BBB:Category Fiv\n"
" e\n"
"CATEGORIES;TYPE=work;ALTID=84;LANGUAGE=kw;PID=86;PREF=88;AAA=BBB:Category Six\n"
+ "PHOTO;ALTID=70;MEDIATYPE=image/png;PID=71;PREF=72;MEEP=MOO:data:image/png;bas\n"
+ " e64,iVBORw0KGgoAAAANSUhEUgAAABEAAAAKCAIAAADdHiL1AAAAJUlEQVQoz2NkwAb+//8PYTAy\n"
+ " MmLKMjGQDuilhxHudBrbM8zCDQCxHQkPeaUvawAAAABJRU5ErkJggg==\n"
+ "PHOTO;TYPE=home;ALTID=20;MEDIATYPE=image/png;PID=21;PREF=22;BEEP=BOOP:data:im\n"
+ " age/png;base64,iVBORw0KGgoAAAANSUhEUgAAABEAAAAKCAIAAADdHiL1AAAAHklEQVQoz2NkY\n"
+ " PjPgAr+owkwMqIpYGIgHYzqGdx6AAKNAxMN5P6+AAAAAElFTkSuQmCC\n"
+ "PHOTO;TYPE=work;ALTID=90;MEDIATYPE=image/png;PID=91;PREF=92;PHOTO=YUP:data:im\n"
+ " age/png;base64,iVBORw0KGgoAAAANSUhEUgAAABEAAAAKCAIAAADdHiL1AAAAIElEQVQoz2MUm\n"
+ " 53EgApepsxF4XfaoylgYiAdjOoZ3HoAeuQD2WdxRzcAAAAASUVORK5CYII=\n"
"END:VCARD";
ASSERT_EQ(CONTACTLOAD_OK, TestFile3.LoadFile("LoadCheck-Load4.vcf"));