X-Git-Url: http://git.tdb.fi/?p=libs%2Fcore.git;a=blobdiff_plain;f=source%2Fio%2Fzlibcompressed.h;h=30894cb9cf2345e7e5d79ed742dfe74e115ab99c;hp=1ee427413ddc1cc448338278fab543f19bbd2ca9;hb=e0266badf098a5cec2512eb693bca771e35fd3ab;hpb=8ed14b63ab6249e9fc2a3a691cf8ffbf49166deb diff --git a/source/io/zlibcompressed.h b/source/io/zlibcompressed.h index 1ee4274..30894cb 100644 --- a/source/io/zlibcompressed.h +++ b/source/io/zlibcompressed.h @@ -3,6 +3,7 @@ #include #include +#include #include "base.h" namespace Msp { @@ -27,7 +28,7 @@ operates on top of another I/O object. To ensure proper termination of the compressed data stream, the ZlibCompressed object must be destroyed before the underlying object is closed. */ -class ZlibCompressed: public Base +class ZlibCompressed: public Base, public sigc::trackable { private: struct Private; @@ -36,6 +37,7 @@ private: unsigned buffer_size; unsigned char *in_buffer; unsigned char *out_buffer; + bool stream_end; Private *priv; public: @@ -44,6 +46,14 @@ public: compression quality, ranging from 1 (fastest) to 9 (best compression). */ ZlibCompressed(Base &, unsigned level = 9); + /** Creates a zlib de/compression object. Mode must be either read or + write, and compatible with the underlying object. */ + ZlibCompressed(Base &, Mode, unsigned level = 9); + +private: + void init(unsigned); + +public: virtual ~ZlibCompressed(); void flush();