summaryrefslogtreecommitdiff
path: root/shared/xml_base.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'shared/xml_base.cpp')
-rw-r--r--shared/xml_base.cpp11
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
bgstack15