A library for working with phylogenetic and population genetic data.
v0.27.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 (GzipInputSource &&)=default
 
 GzipInputSource (GzipInputSource const &)=delete
 
 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 () override
 
GzipInputSourceoperator= (GzipInputSource &&)=default
 
GzipInputSourceoperator= (GzipInputSource const &)=delete
 
- Public Member Functions inherited from BaseInputSource
 BaseInputSource ()=default
 
 BaseInputSource (BaseInputSource &&)=default
 
 BaseInputSource (BaseInputSource const &)=default
 
virtual ~BaseInputSource ()
 
BaseInputSourceoperator= (BaseInputSource &&)=default
 
BaseInputSourceoperator= (BaseInputSource const &)=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 101 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 117 of file gzip_input_source.cpp.

Member Function Documentation

◆ operator=() [1/2]

GzipInputSource& operator= ( GzipInputSource &&  )
default

◆ operator=() [2/2]

GzipInputSource& operator= ( GzipInputSource const &  )
delete

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: