diff options
author | Daniel Wilhelm <daniel@wili.li> | 2014-04-18 17:15:16 +0200 |
---|---|---|
committer | Daniel Wilhelm <daniel@wili.li> | 2014-04-18 17:15:16 +0200 |
commit | bd6336c629841c6db3a6ca53a936d629d34db53b (patch) | |
tree | 3721ef997864108df175ce677a8a7d4342a6f1d2 /shared/serialize.cpp | |
parent | 4.0 (diff) | |
download | FreeFileSync-bd6336c629841c6db3a6ca53a936d629d34db53b.tar.gz FreeFileSync-bd6336c629841c6db3a6ca53a936d629d34db53b.tar.bz2 FreeFileSync-bd6336c629841c6db3a6ca53a936d629d34db53b.zip |
4.1
Diffstat (limited to 'shared/serialize.cpp')
-rw-r--r-- | shared/serialize.cpp | 51 |
1 files changed, 0 insertions, 51 deletions
diff --git a/shared/serialize.cpp b/shared/serialize.cpp deleted file mode 100644 index 06d409df..00000000 --- a/shared/serialize.cpp +++ /dev/null @@ -1,51 +0,0 @@ -// ************************************************************************** -// * This file is part of the FreeFileSync project. It is distributed under * -// * GNU General Public License: http://www.gnu.org/licenses/gpl.html * -// * Copyright (C) 2008-2011 ZenJu (zhnmju123 AT gmx.de) * -// ************************************************************************** - -#include "serialize.h" -#include "i18n.h" - -using namespace zen; - - -void ReadInputStream::throwReadError() const //throw FileError -{ - throw zen::FileError(_("Error reading from synchronization database:") + " \n" + "\"" + errorObjName_.c_str() + "\""); -} - - -ReadInputStream::CharArray ReadInputStream::readArrayC() const -{ - const boost::uint32_t byteCount = readNumberC<boost::uint32_t>(); - CharArray buffer(new std::vector<char>(byteCount)); - if (byteCount > 0) - { - stream_.Read(&(*buffer)[0], byteCount); - check(); - if (stream_.LastRead() != byteCount) //some additional check - throwReadError(); - } - return buffer; -} - - -//-------------------------------------------------------------------------------------------------------- -void WriteOutputStream::throwWriteError() const //throw FileError -{ - throw zen::FileError(_("Error writing to synchronization database:") + " \n" + "\"" + errorObjName_.c_str() + "\""); -} - - -void WriteOutputStream::writeArrayC(const std::vector<char>& buffer) const -{ - writeNumberC<boost::uint32_t>(static_cast<boost::uint32_t>(buffer.size())); - if (buffer.size() > 0) - { - stream_.Write(&buffer[0], buffer.size()); - check(); - if (stream_.LastWrite() != buffer.size()) //some additional check - throwWriteError(); - } -} |