Home | News | Projects | Releases
Bugs | RFE | Repositories | Help
Setup CMake to build for macOS
[xestiaab/.git] / source / convert.cpp
index 0cfaa9f..d734519 100644 (file)
@@ -93,9 +93,7 @@ ConvertResult ConvertContact(wxString InputFormat, wxString OutputFormat,
        wxFile InputFile;
        
        if (!InputFile.Open(InputFilename, wxFile::read, wxS_DEFAULT)){
-               
-               int InputFileErrNo = InputFile.GetLastError();
-               
+                               
                return CONVERTRESULT_INPUTFILEERROR;
                
        }
@@ -136,9 +134,6 @@ ConvertResult ConvertContact(wxString InputFormat, wxString OutputFormat,
                if (vCard4Format.Get("VERSION") != "4.0"){
                        return CONVERTRESULT_INPUTFILEINVALIDFORMAT;
                }
-               
-               // No conversion needs to be as the card is already
-               // in the vCard 4.0 format.
        
        } else if (InputFormat == "vCard3"){
        
@@ -154,7 +149,15 @@ ConvertResult ConvertContact(wxString InputFormat, wxString OutputFormat,
                if (InputvCard.Get("VERSION") != "3.0"){
                        return CONVERTRESULT_INPUTFILEINVALIDFORMAT;
                }
-       
+
+               vCard34Conv vCard34ConvObj;
+               
+               vCard vCard4Format;
+               
+               vCard34ConvObj.ConvertToV4(&InputFileData, &vCard4Format);
+               
+               FinalData = vCard4Format.WriteString();
+               
        }
        
        // Convert the vCard into the required format and
@@ -188,11 +191,12 @@ ConvertResult ConvertContact(wxString InputFormat, wxString OutputFormat,
        } else {
        
                // Write out the data to the console.
-       
-               std::cout << FinalData << std::endl;
+               
+               FinalData.Trim();
+               std::cout << FinalData.ToStdString() << std::endl;
        
        }
        
        return CONVERTRESULT_OK;
        
-}
\ No newline at end of file
+}
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