Home | News | Projects | Releases
Bugs | RFE | Repositories | Help
Added source code, headers and unit testing for UID, VND-* and X-* vCard Properties...
[xestiaab/.git] / source / contacteditor / ContactDataObject.cpp
index 7531af0..bb85052 100644 (file)
@@ -78,6 +78,7 @@ ContactLoadStatus ContactDataObject::LoadFile(wxString Filename){
        bool GenderProcessed = FALSE;
        bool BirthdayProcessed = FALSE;
        bool AnniversaryProcessed = FALSE;
+       bool UIDProcessed = FALSE;
        int ContactLineLen = 0;
        int QuoteBreakPoint = 0;
        int GroupCount = 0;
@@ -104,6 +105,8 @@ ContactLoadStatus ContactDataObject::LoadFile(wxString Filename){
        int CalendarAddressCount = 0;
        int FreeBusyAddressCount = 0;
        int KeyCount = 0;
+       int VendorCount = 0;
+       int XTokenCount = 0;
        wxString ContactLine;
        wxString PropertyLine;
        wxString PropertySeg1;
@@ -206,6 +209,11 @@ ContactLoadStatus ContactDataObject::LoadFile(wxString Filename){
                                
                        ProcessKind(PropertySeg2);
                
+               } else if (Property == wxT("UID") && UIDProcessed == FALSE){
+               
+                       UIDToken = PropertySeg2;
+                       UIDProcessed = TRUE;
+               
                } else if (Property == wxT("MEMBER")){
 
                        ProcessMember(PropertySeg1, PropertySeg2, &GroupCount);
@@ -383,6 +391,17 @@ ContactLoadStatus ContactDataObject::LoadFile(wxString Filename){
                        ProcessKey(PropertySeg1, PropertySeg2, &KeyCount);
                        KeyCount++;
                
+               } else if (Property.Mid(0, 3) == wxT("VND")){
+               
+                       ProcessVendor(PropertySeg1, PropertySeg2, &VendorCount);
+                       VendorCount++;
+               
+               } else if (Property.Mid(0, 2) == wxT("X-")){
+                       
+                       XTokenList.insert(std::make_pair(XTokenCount, PropertySeg2));
+                       XTokenListTokens.insert(std::make_pair(XTokenCount, PropertySeg1.Mid(2)));
+                       XTokenCount++;
+               
                }
                
        }
@@ -5436,6 +5455,41 @@ void ContactDataObject::ProcessKey(wxString PropertySeg1, wxString PropertySeg2,
 
 }
 
+void ContactDataObject::ProcessVendor(wxString PropertySeg1, wxString PropertySeg2, int *VendorCount){
+
+       // Split the Vendor three ways.
+       
+       wxStringTokenizer wSTVendorDetails(PropertySeg1, wxT("-"));
+       
+       wxString wxSVNDID;
+       wxString wxSVNDPropName;
+       long ListCtrlIndex;                     
+
+       while (wSTVendorDetails.HasMoreTokens() == TRUE){
+       
+               wSTVendorDetails.GetNextToken();
+               wxSVNDID = wSTVendorDetails.GetNextToken();
+               wxSVNDPropName = wSTVendorDetails.GetNextToken();
+               break;
+       
+       }
+       
+       if (!wxSVNDID.IsEmpty() && !wxSVNDPropName.IsEmpty()){
+       
+               // Add the data to the vendor variables.
+       
+               VendorList.erase(*VendorCount);
+               VendorListPEN.erase(*VendorCount);
+               VendorListElement.erase(*VendorCount);
+       
+               VendorList.insert(std::make_pair(*VendorCount, PropertySeg2));
+               VendorListPEN.insert(std::make_pair(*VendorCount, wxSVNDID));
+               VendorListElement.insert(std::make_pair(*VendorCount, wxSVNDPropName));
+       
+       }
+
+}
+
 void SplitValues(wxString *PropertyLine, 
        std::map<int,int> *SplitPoints, 
        std::map<int,int> *SplitLength, 
Xestia Software Development
Yn Maystri
© 2006 - 2019 Xestia Software Development
Software

Xestia Address Book
Xestia Calendar
Development

Xestia Gelforn
Everything else

About
News
Privacy Policy