NameLanguage = PropertyValue;
+ } else if (PropertyName == wxT("SORT-AS")){
+
+ if (PropertyValue.Left(1) == wxT("\"") && PropertyValue.Right(1) == wxT("\"") &&
+ PropertyValue.Len() >= 3){
+ NameDisplayAs = PropertyValue.Mid(1, (PropertyValue.Len() - 2));
+ }
+
+ } else if (!PropertyName.IsEmpty() && !PropertyValue.IsEmpty()){
+
+ if (FirstToken == TRUE){
+
+ PropertyTokens.Append(PropertyName + wxT("=") + PropertyValue);
+ FirstToken = FALSE;
+
+ } else {
+
+ PropertyTokens.Append(wxT(";") + PropertyName + wxT("=") + PropertyValue);
+
+ }
+
}
}
+
+ // Split the name data.
+
+ // Add the name token data.
+
+ if (!PropertyTokens.IsEmpty()){
+
+ NameTokens = PropertyTokens;
+
+ }
}
MEMBER;ALTID=35;PID=40;PREF=45;MEDIATYPE=text/plain;EXAMPLE=Meep:7a2af44d-64
31-4797-a55f-d86d56304fda
FN;TYPE=work;LANGUAGE=kw;ALTID=500;PID=40;PREF=45;EXAMPLE=Baaa:Test Contact
-N;ALTID=3;LANGUAGE=kw:Test
+N;ALTID=3;LANGUAGE=kw;SORT-AS="Contact,Test";TEST=Yes:Test
END:VCARD
// Check that the name has been read (N).
- ASSERT_EQ("Test", TestFile.NameForename);
- ASSERT_EQ("3", TestFile.NameAltID);
- ASSERT_EQ("kw", TestFile.NameLanguage);
+ ASSERT_EQ("Test", TestFile.NameForename);
+
+ // Check the ALTID parameter.
+
+ ASSERT_EQ("3", TestFile.NameAltID);
+
+ // Check the LANGUAGE parameter.
+
+ ASSERT_EQ("kw", TestFile.NameLanguage);
+
+ // Check the SORT-AS parameter.
+
+ ASSERT_EQ("Contact,Test", TestFile.NameDisplayAs);
+ // Check the extra tokens parameter.
+
+ ASSERT_EQ("TEST=Yes", TestFile.NameTokens);
}