From 9cc790869ed3905c78c7eeeb0bb44f800b3f2af4 Mon Sep 17 00:00:00 2001 From: Daniel Wilhelm Date: Fri, 18 Apr 2014 17:11:09 +0200 Subject: 3.15 --- shared/xml_base.cpp | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'shared/xml_base.cpp') diff --git a/shared/xml_base.cpp b/shared/xml_base.cpp index c3d04364..3f2a9e48 100644 --- a/shared/xml_base.cpp +++ b/shared/xml_base.cpp @@ -5,8 +5,8 @@ // ************************************************************************** // #include "xml_base.h" -#include #include "file_io.h" +#include "i18n.h" #include "string_conv.h" #include "system_constants.h" #include @@ -68,8 +68,8 @@ void loadRawXmlDocument(const wxString& filename, TiXmlDocument& document) //thr try { - FileInput inputFile(wxToZ(filename)); //throw FileError(); - const size_t bytesRead = inputFile.read(&inputBuffer[0], inputBuffer.size()); //throw FileError() + FileInput inputFile(wxToZ(filename)); //throw (FileError); + const size_t bytesRead = inputFile.read(&inputBuffer[0], inputBuffer.size()); //throw (FileError) if (bytesRead == 0 || bytesRead >= inputBuffer.size()) //treat XML files larger than 2 MB as erroneous: loading larger files just wastes CPU + memory throw XmlError(wxString(_("Error parsing configuration file:")) + wxT("\n\"") + filename + wxT("\"")); @@ -165,14 +165,14 @@ bool saveNecessary(const Zstring& filename, const std::string& dataToWrite) //th { try { - if (ffs3::getFilesize(filename) != static_cast(dataToWrite.size())) //throw FileError(); + if (ffs3::getFilesize(filename) != static_cast(dataToWrite.size())) //throw (FileError); return true; boost::scoped_array inputBuffer(new char[dataToWrite.size() + 1]); //+ 1 in order to test for end of file! - FileInput inputFile(filename); //throw FileError(); + FileInput inputFile(filename); //throw (FileError); - const size_t bytesRead = inputFile.read(inputBuffer.get(), dataToWrite.size() + 1); //throw FileError() + const size_t bytesRead = inputFile.read(inputBuffer.get(), dataToWrite.size() + 1); //throw (FileError) if (bytesRead != dataToWrite.size()) //implicit test for eof! return true; @@ -200,7 +200,7 @@ void xmlAccess::saveXmlDocument(const wxString& filename, const TiXmlDocument& d { try { - FileOutput outputFile(wxToZ(filename)); //throw FileError() + FileOutput outputFile(wxToZ(filename), FileOutput::ACC_OVERWRITE); //throw (FileError) outputFile.write(buffer.c_str(), buffer.length()); // } catch (const FileError& error) //more detailed error messages than with wxWidgets -- cgit