#include <genesis/utils/io/gzip_stream.hpp>
Inherits ostream.
Output stream that offers on-the-fly gzip-compression.
The class accesses an external std::streambuf. It can be constructed from an existing std::ostream (such as std::cout) or std::streambuf.
The GzipOStream destructor flushes all reamining data to the target ostream. However, if the ostream needs to be accessed before the GzipOStream is destroyed (e.g., goes out of scope), the GzipOStream::flush() function can be called manually.
The class is based on the zstr::ostream class of the excellent zstr library by Matei David; see also our Acknowledgements.
If genesis is compiled without zlib support, constructing an instance of this class will throw an exception.
Definition at line 193 of file gzip_stream.hpp.
Public Member Functions | |
GzipOStream (std::ostream &os, GzipCompressionLevel level=GzipCompressionLevel::kDefaultCompression, std::size_t buffer_size=GZIP_DEFAULT_BUFFER_SIZE) | |
GzipOStream (std::streambuf *sbuf_p, GzipCompressionLevel level=GzipCompressionLevel::kDefaultCompression, std::size_t buffer_size=GZIP_DEFAULT_BUFFER_SIZE) | |
virtual | ~GzipOStream () |
GzipOStream | ( | std::ostream & | os, |
GzipCompressionLevel | level = GzipCompressionLevel::kDefaultCompression , |
||
std::size_t | buffer_size = GZIP_DEFAULT_BUFFER_SIZE |
||
) |
Definition at line 518 of file gzip_stream.cpp.
|
explicit |
Definition at line 524 of file gzip_stream.cpp.
|
virtual |
Definition at line 530 of file gzip_stream.cpp.