X-Git-Url: http://git.tdb.fi/?p=libs%2Fcore.git;a=blobdiff_plain;f=source%2Fio%2Fzlibcompressed.h;h=af75aecd51d7d843d92390be68cb1a955e52e2a0;hp=feb21c635d406ea567708119fd2c9d467f697f0c;hb=be8ea216d23bf36bdfb2d3e302638782575fc136;hpb=a386a9ff068071aab19e6dcb0452e72784d84267 diff --git a/source/io/zlibcompressed.h b/source/io/zlibcompressed.h index feb21c6..af75aec 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; @@ -45,8 +46,19 @@ 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(); + virtual void set_block(bool); + virtual void set_inherit(bool); + void flush(); protected: @@ -61,6 +73,8 @@ private: public: virtual unsigned do_read(char *, unsigned); + + virtual const Handle &get_handle(Mode); }; } // namespace IO