A toolkit for working with phylogenetic data.
v0.24.0
GzipInputSource Class Referencefinal

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

Inherits BaseInputSource.

Detailed Description

Input source for reading byte data from a gzip/zlib-compressed source.

This input source is a wrapper that takes some other input source (FileInputSource, StringInputSource, StreamInputSource, etc), and de-compresses using gzip/zlib on the fly while reading.

The class can be moved, but not copied, because of the internal state that is kept for decompression, and which would mess up the input source if copied.

Definition at line 56 of file gzip_input_source.hpp.

Public Member Functions

 GzipInputSource (std::shared_ptr< BaseInputSource > input_source, Format format=Format::kAutomatic)
 Construct the input source using another input source (FileInputSource, StringInputSource, StreamInputSource, etc), and add gzip/zlib decompression on top, using the specified GzipInputSource::Format. More...
 
 GzipInputSource (GzipInputSource const &)=delete
 
 GzipInputSource (GzipInputSource &&)=default
 
 ~GzipInputSource () override
 
GzipInputSourceoperator= (GzipInputSource const &)=delete
 
GzipInputSourceoperator= (GzipInputSource &&)=default
 
- Public Member Functions inherited from BaseInputSource
 BaseInputSource ()=default
 
 BaseInputSource (BaseInputSource const &)=default
 
 BaseInputSource (BaseInputSource &&)=default
 
virtual ~BaseInputSource ()
 
BaseInputSourceoperator= (BaseInputSource const &)=default
 
BaseInputSourceoperator= (BaseInputSource &&)=default
 
size_t read (char *buffer, size_t size)
 Read size many bytes into the char buffer. More...
 
std::string source_name () const
 Get a name of the input source. This is intended for user output. More...
 
std::string source_string () const
 Get a string representing the input source. This is intended for the reader classes, which for example might want to examine the input file name. More...
 

Public Types

enum  Format { kAutomatic, kGzip, kZlib, kDeflate }
 Format used by gzip/zlib for decompression. More...
 

Constructor & Destructor Documentation

◆ GzipInputSource() [1/3]

GzipInputSource ( std::shared_ptr< BaseInputSource input_source,
GzipInputSource::Format  format = Format::kAutomatic 
)
explicit

Construct the input source using another input source (FileInputSource, StringInputSource, StreamInputSource, etc), and add gzip/zlib decompression on top, using the specified GzipInputSource::Format.

Definition at line 94 of file gzip_input_source.cpp.

◆ GzipInputSource() [2/3]

GzipInputSource ( GzipInputSource const &  )
delete

◆ GzipInputSource() [3/3]

GzipInputSource ( GzipInputSource &&  )
default

◆ ~GzipInputSource()

~GzipInputSource ( )
override

Definition at line 120 of file gzip_input_source.cpp.

Member Function Documentation

◆ operator=() [1/2]

GzipInputSource& operator= ( GzipInputSource const &  )
delete

◆ operator=() [2/2]

GzipInputSource& operator= ( GzipInputSource &&  )
default

Member Enumeration Documentation

◆ Format

enum Format
strong

Format used by gzip/zlib for decompression.

Enumerator
kAutomatic 

Enable automatic header detection, allowing either gzip or zlib.

kGzip 

Use gzip decompression.

kZlib 

Use zlib decompression.

kDeflate 

Use a pure deflate decompression.

Definition at line 67 of file gzip_input_source.hpp.


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