bool QuoteMode = FALSE;
bool PropertyFind = TRUE;
bool KindProcessed = FALSE;
+ bool NameProcessed = FALSE;
int ContactLineLen = 0;
int QuoteBreakPoint = 0;
int GroupCount = 0;
ProcessFN(PropertySeg1, PropertySeg2, &FNCount);
FNCount++;
+ } else if (Property == wxT("N") && NameProcessed == FALSE){
+
+ ProcessN(PropertySeg1, PropertySeg2);
+ NameProcessed = TRUE;
+
}
}
}
+void ContactDataObject::ProcessN(wxString PropertySeg1, wxString PropertySeg2){
+
+ std::map<int, int> SplitPoints;
+ std::map<int, int> SplitLength;
+
+ int intPrevValue = 3;
+ int intPref = 0;
+ int intType = 0;
+
+ SplitValues(&PropertySeg1, &SplitPoints, &SplitLength, intPrevValue);
+
+ intPrevValue = 2;
+
+ NameForename = PropertySeg2;
+
+ wxString PropertyName;
+ wxString PropertyValue;
+ wxString PropertyData;
+ wxString PropertyTokens;
+ std::map<int,int>::iterator SLiter;
+ bool FirstToken = TRUE;
+
+ for (std::map<int, int>::iterator intiter = SplitPoints.begin();
+ intiter != SplitPoints.end(); ++intiter){
+
+ SLiter = SplitLength.find(intiter->first);
+
+ PropertyData = PropertySeg1.Mid(intPrevValue, (SLiter->second));
+
+ wxStringTokenizer PropertyElement (PropertyData, wxT("="));
+ PropertyName = PropertyElement.GetNextToken();
+ PropertyValue = PropertyElement.GetNextToken();
+
+ intPrevValue = intiter->second;
+
+ CaptureString(&PropertyValue, FALSE);
+
+ if (PropertyName == wxT("ALTID")){
+
+ NameAltID = PropertyValue;
+
+ } else if (PropertyName == wxT("LANGUAGE")){
+
+ NameLanguage = PropertyValue;
+
+ }
+
+ }
+
+}
+
void SplitValues(wxString *PropertyLine,
std::map<int,int> *SplitPoints,
std::map<int,int> *SplitLength,
ASSERT_NE(TestFile.FullNamesListTokens.end(), TestFileIter);
ASSERT_EQ("EXAMPLE=Baaa", TestFileIter->second);
+ // Check that the name has been read (N).
+
+ ASSERT_EQ("Test", TestFile.NameForename);
+ ASSERT_EQ("3", TestFile.NameAltID);
+ ASSERT_EQ("kw", TestFile.NameLanguage);
+
+
}
// TODO: Add tests for the Contact Loading process.
\ No newline at end of file