3 // vcard.cpp - Deals with vCard 4.0 formatted files meeting the
4 // RFC 6350 specification.
14 void vCard::Add(wxString SettingName, wxString SettingValue){
16 // Check for backslashes used for commas, newlines and
17 // backslashes used for values.
19 SettingValue.Replace(wxT("\\n"), wxT("\n"));
20 SettingValue.Replace(wxT("\\,"), wxT(","));
21 SettingValue.Replace(wxT("\\\\"), wxT("\\"));
23 // Check data to make sure that it meets the required
24 // vCard 4.0 specifications.
26 //wxPuts(wxString::Format("%x", SettingValue));
28 if (SettingName == wxT("BEGIN") && SettingValue == wxT("VCARD")){
32 if (SettingName == wxT("END") && SettingValue == wxT("VCARD")){
36 if (SettingName == wxT("FN")){
40 if (SettingName == wxT("VERSION") && SettingValue == wxT("4.0")){
44 SettingNames.Add(SettingName, 1);
45 SettingValues.Add(SettingValue, 1);
50 wxString vCard::Get(wxString SettingName){
52 wxString SettingValue;
54 wxPuts(wxT("IN THAR"));
56 // Look for the setting name.
58 for (int i = 0; i < SettingCount; i++){
59 wxPuts(wxT("Looking"));
61 if (SettingNames[i] == SettingName){
62 SettingValue = SettingValues[i];
63 wxPuts(wxT("Here we are"));
65 SettingValue.Trim(TRUE);
73 wxString vCard::GetById(int id){
77 bool vCard::MeetBaseSpecification(){
78 // Check and see if the vCard object meets the base specification
81 if (vCardBegin == TRUE && vCardEnd == TRUE && vCardFN == TRUE &&