A library for working with phylogenetic and population genetic data.
v0.32.0
GzipOStream Class Reference

#include <genesis/utils/io/gzip_stream.hpp>

Inherits ostream.

Detailed Description

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.

See also
GzipIStream
GzipIFStream
GzipOFStream

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 ()
 

Constructor & Destructor Documentation

◆ GzipOStream() [1/2]

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.

◆ GzipOStream() [2/2]

GzipOStream ( std::streambuf *  sbuf_p,
GzipCompressionLevel  level = GzipCompressionLevel::kDefaultCompression,
std::size_t  buffer_size = GZIP_DEFAULT_BUFFER_SIZE 
)
explicit

Definition at line 524 of file gzip_stream.cpp.

◆ ~GzipOStream()

~GzipOStream ( )
virtual

Definition at line 530 of file gzip_stream.cpp.


The documentation for this class was generated from the following files: