summaryrefslogtreecommitdiff
path: root/shared/serialize.cpp
diff options
context:
space:
mode:
authorDaniel Wilhelm <daniel@wili.li>2014-04-18 17:07:43 +0200
committerDaniel Wilhelm <daniel@wili.li>2014-04-18 17:07:43 +0200
commit4226e548662339ea1ca37b45385a7cf9b237ff1e (patch)
tree9a3fa54b85d97f05164e41bdb96b82f748a37342 /shared/serialize.cpp
parent3.7 (diff)
downloadFreeFileSync-4226e548662339ea1ca37b45385a7cf9b237ff1e.tar.gz
FreeFileSync-4226e548662339ea1ca37b45385a7cf9b237ff1e.tar.bz2
FreeFileSync-4226e548662339ea1ca37b45385a7cf9b237ff1e.zip
3.8
Diffstat (limited to 'shared/serialize.cpp')
-rw-r--r--shared/serialize.cpp11
1 files changed, 5 insertions, 6 deletions
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<char>);
const size_t byteCount = readNumberC<size_t>();
+ CharArray buffer(new std::vector<char>(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<char>& buffer)
+void WriteOutputStream::writeArrayC(const std::vector<char>& buffer) const
{
writeNumberC<size_t>(buffer.size());
if (buffer.size() > 0)
bgstack15