]> git.tdb.fi Git - libs/core.git/blobdiff - source/io/zlibcompressed.h
Move non-oneliner functions out of RefPtr class declaration
[libs/core.git] / source / io / zlibcompressed.h
index 1ee427413ddc1cc448338278fab543f19bbd2ca9..af75aecd51d7d843d92390be68cb1a955e52e2a0 100644 (file)
@@ -3,6 +3,7 @@
 
 #include <stdexcept>
 #include <string>
+#include <sigc++/trackable.h>
 #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,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:
@@ -60,6 +73,8 @@ private:
 
 public:
        virtual unsigned do_read(char *, unsigned);
+
+       virtual const Handle &get_handle(Mode);
 };
 
 } // namespace IO