diff options
author | Daniel Wilhelm <daniel@wili.li> | 2014-04-18 17:12:46 +0200 |
---|---|---|
committer | Daniel Wilhelm <daniel@wili.li> | 2014-04-18 17:12:46 +0200 |
commit | b338e29fd3eaf700f8c8360aa0310048ba941d54 (patch) | |
tree | 122f8ef3790d12cd10275ef7453a9e8053322d78 /shared/xml_base.cpp | |
parent | 3.18 (diff) | |
download | FreeFileSync-b338e29fd3eaf700f8c8360aa0310048ba941d54.tar.gz FreeFileSync-b338e29fd3eaf700f8c8360aa0310048ba941d54.tar.bz2 FreeFileSync-b338e29fd3eaf700f8c8360aa0310048ba941d54.zip |
3.19
Diffstat (limited to 'shared/xml_base.cpp')
-rw-r--r-- | shared/xml_base.cpp | 11 |
1 files changed, 5 insertions, 6 deletions
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 <string_conv.h> #include <file_io.h> #include <i18n.h> -#include <system_constants.h> 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 = "<?xml version="; std::vector<char> 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<size_t>(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<size_t>(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 |