// RFC 6350 specification.
vCard34Conv::vCard34Conv(){
- vCardBegin = FALSE;
- vCardEnd = FALSE;
- vCardFN = FALSE;
- vCardVersion = 0.0;
- SettingCount = 0;
+
+ vCardBegin = FALSE;
+ vCardEnd = FALSE;
+ vCardFN = FALSE;
+ vCardVersion = 0.0;
+ SettingCount = 0;
+
}
void vCard34Conv::ConvertV4PropertyProc(wxString *wxSPropertyName,
intPrevValue = intiter->second;
if (PropertyName == wxT("type") && PropertyValue == wxT("INTERNET")){
+
continue;
+
}
if (PropertyName == wxT("type") && PropertyValue == wxT("pref")){
if (ProcessItemData == FALSE){
+
PropertyName = wxT("PREF");
PropertyValue = wxT("50");
+
} else {
+
continue;
+
}
}
if (PropertyName == wxT("type") && (PropertyValue == wxT("HOME") || PropertyValue == wxT("home"))){
+
PropertyValue = wxT("home");
+
}
if (PropertyName == wxT("type") && (PropertyValue == wxT("WORK") || PropertyValue == wxT("work"))){
+
PropertyValue = wxT("work");
+
}
if (PropertyName == wxT("type") && (PropertyValue == wxT("OTHER") || PropertyValue == wxT("other"))){
+
PropertyName = wxT("X-TYPE");
PropertyValue = wxT("other");
+
}
// Process properties.
if (PropertyName == wxT("type") && PropertyValue == wxT("pref")){
if (ProcessItemData == FALSE){
+
PropertyName = wxT("PREF");
PropertyValue = wxT("50");
+
} else {
+
continue;
+
}
}
if (PropertyName == wxT("type") && (PropertyValue == wxT("HOME") || PropertyValue == wxT("home"))){
+
PropertyValue = wxT("home");
+
}
if (PropertyName == wxT("type") && (PropertyValue == wxT("WORK") || PropertyValue == wxT("work"))){
+
PropertyValue = wxT("work");
+
}
if (PropertyName == wxT("type") && (PropertyValue == wxT("OTHER") || PropertyValue == wxT("other"))){
+
PropertyName = wxT("X-TYPE");
PropertyValue = wxT("other");
+
}
// Process properties.
intPrevValue = intiter->second;
if (PropertyName == wxT("type") && PropertyValue == wxT("pref")){
+
continue;
+
}
if (PropertyName == wxT("type") && (PropertyValue == wxT("HOME") || PropertyValue == wxT("home"))){
+
PropertyValue = wxT("home");
+
}
if (PropertyName == wxT("type") && (PropertyValue == wxT("WORK") || PropertyValue == wxT("work"))){
+
PropertyValue = wxT("work");
+
}
if (PropertyName == wxT("type") && (PropertyValue == wxT("OTHER") || PropertyValue == wxT("other"))){
+
PropertyName = wxT("X-TYPE");
PropertyValue = wxT("other");
+
}
// Process properties.
intPrevValue = intiter->second;
if (PropertyName == wxT("type") && PropertyValue == wxT("pref")){
+
continue;
+
}
if (PropertyName == wxT("X-SERVICE-TYPE")){
+
continue;
+
}
if (PropertyName == wxT("type") && (PropertyValue == wxT("HOME") || PropertyValue == wxT("home"))){
+
PropertyValue = wxT("home");
+
}
if (PropertyName == wxT("type") && (PropertyValue == wxT("WORK") || PropertyValue == wxT("work"))){
+
PropertyValue = wxT("work");
+
}
if (PropertyName == wxT("type") && (PropertyValue == wxT("OTHER") || PropertyValue == wxT("other"))){
+
PropertyName = wxT("X-TYPE");
PropertyValue = wxT("other");
+
}
// Process properties.
intPrevValue = intiter->second;
if (PropertyName == wxT("type") && PropertyValue == wxT("pref")){
+
continue;
+
}
if (PropertyName == wxT("type") && (PropertyValue == wxT("HOME") || PropertyValue == wxT("home"))){
+
TelType.insert(std::make_pair(wxT("home"), wxT("home")));
continue;
+
}
if (PropertyName == wxT("type") && (PropertyValue == wxT("WORK") || PropertyValue == wxT("work"))){
+
TelType.insert(std::make_pair(wxT("work"), wxT("work")));
continue;
+
}
if (PropertyName == wxT("type") && (PropertyValue == wxT("OTHER") || PropertyValue == wxT("other"))){
+
PropertyName = wxT("X-TYPE");
PropertyValue = wxT("other");
+
}
// Process the telephone type options.
// text
if (PropertyName == wxT("type") && (PropertyValue == wxT("TEXT") || PropertyValue == wxT("text"))){
+
TelType.insert(std::make_pair(wxT("text"), wxT("text")));
continue;
+
}
// voice
if (PropertyName == wxT("type") && (PropertyValue == wxT("VOICE") || PropertyValue == wxT("voice"))){
+
TelType.insert(std::make_pair(wxT("voice"), wxT("voice")));
continue;
+
}
// fax
if (PropertyName == wxT("type") && (PropertyValue == wxT("FAX") || PropertyValue == wxT("fax"))){
+
TelType.insert(std::make_pair(wxT("fax"), wxT("fax")));
continue;
+
}
// cell
if (PropertyName == wxT("type") && (PropertyValue == wxT("CELL") || PropertyValue == wxT("cell"))){
+
TelType.insert(std::make_pair(wxT("cell"), wxT("cell")));
continue;
+
}
// video
if (PropertyName == wxT("type") && (PropertyValue == wxT("VIDEO") || PropertyValue == wxT("video"))){
+
TelType.insert(std::make_pair(wxT("video"), wxT("video")));
continue;
+
}
// pager
if (PropertyName == wxT("type") && (PropertyValue == wxT("PAGER") || PropertyValue == wxT("pager"))){
+
TelType.insert(std::make_pair(wxT("pager"), wxT("pager")));
continue;
+
}
// textphone
if (PropertyName == wxT("type") && (PropertyValue == wxT("TEXTPHONE") || PropertyValue == wxT("textphone"))){
+
TelType.insert(std::make_pair(wxT("textphone"), wxT("textphone")));
continue;
+
}
if (PropertyName == wxT("type") && PropertyValue.Find(wxT(",")) != wxNOT_FOUND){
+
wxStringTokenizer TypeSplit(PropertyValue, wxT(","));
wxString TypeSplitData;
while (TypeSplit.HasMoreTokens()){
intPrevValue = intiter->second;
if (PropertyName == wxT("type") && PropertyValue == wxT("pref")){
+
continue;
+
}
// Process properties.
intPrevValue = intiter->second;
if (PropertyName == wxT("type") && PropertyValue == wxT("pref")){
+
continue;
+
}
if (PropertyName == wxT("type") && (PropertyValue == wxT("HOME") || PropertyValue == wxT("home"))){
+
PropertyValue = wxT("home");
+
}
if (PropertyName == wxT("type") && (PropertyValue == wxT("WORK") || PropertyValue == wxT("work"))){
+
PropertyValue = wxT("work");
+
}
if (PropertyName == wxT("type") && (PropertyValue == wxT("OTHER") || PropertyValue == wxT("other"))){
+
PropertyName = wxT("X-TYPE");
PropertyValue = wxT("other");
+
}
// Process properties.
wxString PropertyValue;
wxString PropertyTokens;
bool FirstToken = TRUE;
- int intPrevValue = 3;
+ int intPrevValue = 3;
wxSPropertyDataOut->Append(*wxSPropertySeg2Ptr);
*wxSPropertyDataNameOut = wxT("N");
wxString PropertyName;
wxString PropertyValue;
wxString PropertyTokens;
- bool FirstToken = TRUE;
+ bool FirstToken = TRUE;
int intPrevValue = 12;
if (ProcessItemData == TRUE){
if (PropertyLine->Mid(i, 1) == wxT(";") &&
PropertyLine->Mid((i - 1), 1) != wxT("\\")){
- if (intSplitsFound == 0){
+ if (intSplitsFound == 0){
- SplitLength->insert(std::make_pair(intSplitsFound, (intSplitSize)));
+ SplitLength->insert(std::make_pair(intSplitsFound, (intSplitSize)));
- } else {
+ } else {
- SplitLength->insert(std::make_pair(intSplitsFound, (intSplitSize - 1)));
+ SplitLength->insert(std::make_pair(intSplitsFound, (intSplitSize - 1)));
- }
+ }
- SplitPoints->insert(std::make_pair(intSplitsFound, (i + 1)));
+ SplitPoints->insert(std::make_pair(intSplitsFound, (i + 1)));
- intSplitsFound++;
- intSplitSeek = i;
- intSplitSize = 0;
+ intSplitsFound++;
+ intSplitSeek = i;
+ intSplitSize = 0;
}
if (PropertyLine->Mid(i, 1) == wxT(";") &&
PropertyLine->Mid((i - 1), 1) != wxT("\\")){
- if (intSplitsFound == 0){
+ if (intSplitsFound == 0){
DataStr = PropertyLine->Mid(intSplitSeek, (intSplitSize));
SplitLength->insert(std::make_pair(intSplitsFound, (intSplitSize)));
}
- SplitPoints->insert(std::make_pair(intSplitsFound, (i + 1)));
+ SplitPoints->insert(std::make_pair(intSplitsFound, (i + 1)));
- intSplitsFound++;
- intSplitSeek = (i + 1);
- intSplitSize = 0;
+ intSplitsFound++;
+ intSplitSeek = (i + 1);
+ intSplitSize = 0;
- if (!DataStr.IsEmpty()){
+ if (!DataStr.IsEmpty()){
- PropertyElement.SetString(DataStr, wxT("="));
- PropertyName = PropertyElement.GetNextToken();
- PropertyValue = PropertyElement.GetNextToken();
- SplitData->insert(std::make_pair(PropertyName, PropertyValue));
+ PropertyElement.SetString(DataStr, wxT("="));
+ PropertyName = PropertyElement.GetNextToken();
+ PropertyValue = PropertyElement.GetNextToken();
+ SplitData->insert(std::make_pair(PropertyName, PropertyValue));
- }
+ }
- DataStr.clear();
- PropertyName.clear();
- PropertyValue.clear();
+ DataStr.clear();
+ PropertyName.clear();
+ PropertyValue.clear();
}