#include <genesis/utils/io/gzip_input_source.hpp>
Inherits BaseInputSource.
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 | |
GzipInputSource & | operator= (GzipInputSource &&)=default |
GzipInputSource & | operator= (GzipInputSource const &)=delete |
Public Member Functions inherited from BaseInputSource | |
BaseInputSource ()=default | |
BaseInputSource (BaseInputSource &&)=default | |
BaseInputSource (BaseInputSource const &)=default | |
virtual | ~BaseInputSource () |
BaseInputSource & | operator= (BaseInputSource &&)=default |
BaseInputSource & | operator= (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... | |
|
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.
|
delete |
|
default |
|
override |
Definition at line 117 of file gzip_input_source.cpp.
|
default |
|
delete |
|
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.