&BusinessWebsiteListPID, &BusinessWebsiteListType,
&BusinessWebsiteListMediatype, &BusinessWebsiteListPref,
&BusinessWebsiteListTokens, SaveData, "work");
+
+ // Process ROLE.
+
+ SaveRole(&GeneralRoleList, &GeneralRoleListLanguage,
+ &GeneralRoleListAltID, &GeneralRoleListPID,
+ &GeneralRoleListType, &GeneralRoleListPref,
+ &GeneralRoleListTokens, SaveData, "");
+ SaveRole(&HomeRoleList, &HomeRoleListLanguage,
+ &HomeRoleListAltID, &HomeRoleListPID,
+ &HomeRoleListType, &HomeRoleListPref,
+ &HomeRoleListTokens, SaveData, "home");
+ SaveRole(&BusinessRoleList, &BusinessRoleListLanguage,
+ &BusinessRoleListAltID, &BusinessRoleListPID,
+ &BusinessRoleListType, &BusinessRoleListPref,
+ &BusinessRoleListTokens, SaveData, "work");
// Write the end part of the vCard data file.
}
+}
+
+void ContactDataObject::SaveRole(map<int, wxString> *RoleList, map<int, wxString> *RoleListLanguage,
+ map<int, wxString> *RoleListAltID, map<int, wxString> *RoleListPID,
+ map<int, wxString> *RoleListType, map<int, int> *RoleListPref,
+ map<int, wxString> *RoleListTokens, wxString *SaveData, wxString DataType){
+
+ wxString ProcessData = "";
+
+ for (std::map<int, wxString>::iterator RoleIter = RoleList->begin();
+ RoleIter != RoleList->end(); RoleIter++){
+
+ ProcessData.Append("ROLE");
+
+ // Check if there is a value for TYPE.
+
+ if (DataType.size() > 0){
+
+ ProcessData.Append(";TYPE=");
+ ProcessData.Append(DataType);
+
+ }
+
+ // Check if there is a value for ALTID.
+
+ if ((*RoleListAltID)[RoleIter->first].size() > 0){
+
+ ProcessData.Append(";ALTID=");
+ ProcessData.Append((*RoleListAltID)[RoleIter->first]);
+
+ }
+
+ // Check if there is a value for LANGUAGE.
+
+ if ((*RoleListLanguage)[RoleIter->first].size() > 0){
+
+ ProcessData.Append(";LANGUAGE=");
+ ProcessData.Append((*RoleListLanguage)[RoleIter->first]);
+
+ }
+
+ // Check if there is a value for PID.
+
+ if ((*RoleListPID)[RoleIter->first].size() > 0){
+
+ ProcessData.Append(";PID=");
+ ProcessData.Append((*RoleListPID)[RoleIter->first]);
+
+ }
+
+ // Check if there is a value for PREF.
+
+ if ((*RoleListPref)[RoleIter->first] > 0){
+
+ ProcessData.Append(";PREF=");
+ ProcessData.Append(wxString::Format("%i", (*RoleListPref)[RoleIter->first]));
+
+ }
+
+ // Check if there is a value for tokens.
+
+ if ((*RoleListTokens)[RoleIter->first].size() > 0){
+
+ ProcessData.Append(";");
+ ProcessData.Append((*RoleListTokens)[RoleIter->first]);
+
+ }
+
+ ProcessData.Append(":");
+ ProcessData.Append(RoleIter->second);
+ ProcessData.Append("\n");
+
+ ProcessData = OutputText(&ProcessData);
+
+ SaveData->Append(ProcessData);
+ ProcessData.clear();
+
+ }
+
}
\ No newline at end of file
map<int, wxString> *WebsiteListPID, map<int, wxString> *WebsiteListType,
map<int, wxString> *WebsiteListMediatype, map<int, int> *WebsiteListPref,
map<int, wxString> *WebsiteListTokens, wxString *SaveData, wxString DataType);
+ void SaveRole(map<int, wxString> *RoleList, map<int, wxString> *RoleListLanguage,
+ map<int, wxString> *RoleListAltID, map<int, wxString> *RoleListPID,
+ map<int, wxString> *RoleListType, map<int, int> *RoleListPref,
+ map<int, wxString> *RoleListTokens, wxString *SaveData, wxString DataType);
public: