From b338e29fd3eaf700f8c8360aa0310048ba941d54 Mon Sep 17 00:00:00 2001 From: Daniel Wilhelm Date: Fri, 18 Apr 2014 17:12:46 +0200 Subject: 3.19 --- shared/xml_base.cpp | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) (limited to 'shared/xml_base.cpp') diff --git a/shared/xml_base.cpp b/shared/xml_base.cpp index 3b786fe8..cd9f58a6 100644 --- a/shared/xml_base.cpp +++ b/shared/xml_base.cpp @@ -9,7 +9,6 @@ #include #include #include -#include using namespace zen; @@ -19,14 +18,14 @@ void xmlAccess::loadXmlDocument(const wxString& filename, XmlDoc& doc) //throw F std::string stream; try { - const zen::UInt64 fs = zen::getFilesize(wxToZ(filename)); //throw (FileError) + const zen::UInt64 fs = zen::getFilesize(toZ(filename)); //throw (FileError) { //quick test whether input is an XML: avoid loading large binary files up front! //doesn't correctly handle BOM! (but no issue yet...) const std::string xmlBegin = " buffer(xmlBegin.size()); - FileInput inputFile(wxToZ(filename)); //throw (FileError); + FileInput inputFile(toZ(filename)); //throw (FileError); const size_t bytesRead = inputFile.read(&buffer[0], buffer.size()); //throw (FileError) if (bytesRead < xmlBegin.size() || !std::equal(buffer.begin(), buffer.end(), xmlBegin.begin())) throw FfsXmlError(wxString(_("Error parsing configuration file:")) + wxT("\n\"") + filename + wxT("\"")); @@ -34,7 +33,7 @@ void xmlAccess::loadXmlDocument(const wxString& filename, XmlDoc& doc) //throw F stream.resize(to(fs)); - FileInput inputFile(wxToZ(filename)); //throw (FileError); + FileInput inputFile(toZ(filename)); //throw (FileError); const size_t bytesRead = inputFile.read(&stream[0], stream.size()); //throw (FileError) if (bytesRead < to(fs)) { @@ -77,7 +76,7 @@ void xmlAccess::saveXmlDocument(const zen::XmlDoc& doc, const wxString& filename bool saveNecessary = true; try { - if (zen::getFilesize(wxToZ(filename)) == stream.size()) //throw FileError + if (zen::getFilesize(toZ(filename)) == stream.size()) //throw FileError try { if (zen::loadStream(filename) == stream) //throw XmlFileError @@ -90,7 +89,7 @@ void xmlAccess::saveXmlDocument(const zen::XmlDoc& doc, const wxString& filename if (saveNecessary) try { - FileOutput outputFile(wxToZ(filename), FileOutput::ACC_OVERWRITE); //throw (FileError) + FileOutput outputFile(toZ(filename), FileOutput::ACC_OVERWRITE); //throw (FileError) outputFile.write(stream.c_str(), stream.length()); // } catch (const FileError& error) //more detailed error messages than with wxWidgets -- cgit