From 4226e548662339ea1ca37b45385a7cf9b237ff1e Mon Sep 17 00:00:00 2001 From: Daniel Wilhelm Date: Fri, 18 Apr 2014 17:07:43 +0200 Subject: 3.8 --- shared/serialize.cpp | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) (limited to 'shared/serialize.cpp') diff --git a/shared/serialize.cpp b/shared/serialize.cpp index f819cb33..63e2037f 100644 --- a/shared/serialize.cpp +++ b/shared/serialize.cpp @@ -10,20 +10,19 @@ using namespace Utility; -void ReadInputStream::throwReadError() //throw FileError() +void ReadInputStream::throwReadError() const //throw FileError() { throw FreeFileSync::FileError(wxString(_("Error reading from synchronization database:")) + wxT(" \n") + wxT("\"") + errorObjName_ + wxT("\"")); } -ReadInputStream::CharArray ReadInputStream::readArrayC() +ReadInputStream::CharArray ReadInputStream::readArrayC() const { - CharArray buffer(new std::vector); const size_t byteCount = readNumberC(); + CharArray buffer(new std::vector(byteCount)); if (byteCount > 0) { - buffer->resize(byteCount); stream_.Read(&(*buffer)[0], byteCount); check(); if (stream_.LastRead() != byteCount) //some additional check @@ -34,14 +33,14 @@ ReadInputStream::CharArray ReadInputStream::readArrayC() //-------------------------------------------------------------------------------------------------------- -void WriteOutputStream::throwWriteError() //throw FileError() +void WriteOutputStream::throwWriteError() const //throw FileError() { throw FreeFileSync::FileError(wxString(_("Error writing to synchronization database:")) + wxT(" \n") + wxT("\"") + errorObjName_ + wxT("\"")); } -void WriteOutputStream::writeArrayC(const std::vector& buffer) +void WriteOutputStream::writeArrayC(const std::vector& buffer) const { writeNumberC(buffer.size()); if (buffer.size() > 0) -- cgit