diff options
Diffstat (limited to 'Swiften/StreamStack/CompressionLayer.h')
-rw-r--r-- | Swiften/StreamStack/CompressionLayer.h | 72 |
1 files changed, 36 insertions, 36 deletions
diff --git a/Swiften/StreamStack/CompressionLayer.h b/Swiften/StreamStack/CompressionLayer.h index db43b60..04a9251 100644 --- a/Swiften/StreamStack/CompressionLayer.h +++ b/Swiften/StreamStack/CompressionLayer.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2010-2015 Isode Limited. + * Copyright (c) 2010-2016 Isode Limited. * All rights reserved. * See the COPYING file for more information. */ @@ -7,46 +7,46 @@ #pragma once #include <boost/noncopyable.hpp> -#include <Swiften/Base/boost_bsignals.h> +#include <boost/signals2.hpp> #include <Swiften/Base/API.h> #include <Swiften/Base/SafeByteArray.h> -#include <Swiften/StreamStack/StreamLayer.h> -#include <Swiften/Compress/ZLibException.h> #include <Swiften/Compress/ZLibCompressor.h> #include <Swiften/Compress/ZLibDecompressor.h> +#include <Swiften/Compress/ZLibException.h> +#include <Swiften/StreamStack/StreamLayer.h> namespace Swift { - class ZLibCompressor; - class ZLibDecompressor; - - class SWIFTEN_API CompressionLayer : public StreamLayer, boost::noncopyable { - public: - CompressionLayer() {} - - virtual void writeData(const SafeByteArray& data) { - try { - writeDataToChildLayer(compressor_.process(data)); - } - catch (const ZLibException&) { - onError(); - } - } - - virtual void handleDataRead(const SafeByteArray& data) { - try { - writeDataToParentLayer(decompressor_.process(data)); - } - catch (const ZLibException&) { - onError(); - } - } - - public: - boost::signal<void ()> onError; - - private: - ZLibCompressor compressor_; - ZLibDecompressor decompressor_; - }; + class ZLibCompressor; + class ZLibDecompressor; + + class SWIFTEN_API CompressionLayer : public StreamLayer, boost::noncopyable { + public: + CompressionLayer() {} + + virtual void writeData(const SafeByteArray& data) { + try { + writeDataToChildLayer(compressor_.process(data)); + } + catch (const ZLibException&) { + onError(); + } + } + + virtual void handleDataRead(const SafeByteArray& data) { + try { + writeDataToParentLayer(decompressor_.process(data)); + } + catch (const ZLibException&) { + onError(); + } + } + + public: + boost::signals2::signal<void ()> onError; + + private: + ZLibCompressor compressor_; + ZLibDecompressor decompressor_; + }; } |