diff options
author | Daniel Wilhelm <daniel@wili.li> | 2014-04-18 17:11:09 +0200 |
---|---|---|
committer | Daniel Wilhelm <daniel@wili.li> | 2014-04-18 17:11:09 +0200 |
commit | 9cc790869ed3905c78c7eeeb0bb44f800b3f2af4 (patch) | |
tree | 1c085bbf2302be294866c4fc6e0d225f8abbc346 /shared/xml_base.cpp | |
parent | 3.14 (diff) | |
download | FreeFileSync-9cc790869ed3905c78c7eeeb0bb44f800b3f2af4.tar.gz FreeFileSync-9cc790869ed3905c78c7eeeb0bb44f800b3f2af4.tar.bz2 FreeFileSync-9cc790869ed3905c78c7eeeb0bb44f800b3f2af4.zip |
3.15
Diffstat (limited to 'shared/xml_base.cpp')
-rw-r--r-- | shared/xml_base.cpp | 14 |
1 files changed, 7 insertions, 7 deletions
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 <wx/intl.h> #include "file_io.h" +#include "i18n.h" #include "string_conv.h" #include "system_constants.h" #include <boost/scoped_array.hpp> @@ -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<unsigned long>(dataToWrite.size())) //throw FileError(); + if (ffs3::getFilesize(filename) != static_cast<unsigned long>(dataToWrite.size())) //throw (FileError); return true; boost::scoped_array<char> 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 |