From 64e6d2abc719869e386caa760bfbe1e65bd7559b Mon Sep 17 00:00:00 2001 From: ljfa Date: Mon, 21 Sep 2015 08:30:25 +0200 Subject: Create ozlibstream::close method Set failbit on output stream on failure --- include/io/ozlibstream.h | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'include') diff --git a/include/io/ozlibstream.h b/include/io/ozlibstream.h index d4ea8c2840..770db0029d 100644 --- a/include/io/ozlibstream.h +++ b/include/io/ozlibstream.h @@ -48,6 +48,8 @@ public: std::ostream& get_ostr() const { return os; } + ///Finishes compression and writes all pending data to the output + void close(); private: std::ostream& os; std::vector in; @@ -84,6 +86,8 @@ public: ///@return the wrapped ostream std::ostream& get_ostr() const { return buf.get_ostr(); } + ///Finishes compression and writes all pending data to the output + void close() { buf.close(); } private: deflate_streambuf buf; }; -- cgit 0.0.5-2-1-g0f52