X-Git-Url: http://Server1/repobrowser/?p=xestiaab%2F.git;a=blobdiff_plain;f=source%2Fconvert.cpp;h=d7345196e3163d26ed772376f4ac3cde85d8fa2c;hp=0cfaa9f352e8c4ef153aa37d62c4d48f3c24c9f7;hb=3ef806261b5482a584e05dc8311c8d7633f146b4;hpb=0177e3dca8765fcab7ca524f3ba0f243a972fdfb diff --git a/source/convert.cpp b/source/convert.cpp index 0cfaa9f..d734519 100644 --- a/source/convert.cpp +++ b/source/convert.cpp @@ -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 +}