1#ifndef BYTEME_GZIP_FILE_READER_HPP
2#define BYTEME_GZIP_FILE_READER_HPP
11#include "SelfClosingGzFile.hpp"
47 set_optional_gzbuffer_size(my_gzfile, options.
buffer_size);
51 std::size_t
read(
unsigned char* buffer, std::size_t n) {
56 return safe_read<int>(buffer, n, [
this](
unsigned char* buffer,
int n) ->
int {
57 const auto ret = gzread(this->my_gzfile.handle, buffer, n);
60 const auto msg = gzerror(this->my_gzfile.handle, &status);
62 throw std::runtime_error(msg);
70 SelfClosingGzFile my_gzfile;
Read uncompressed bytes from a Gzip-compressed file.
Definition GzipFileReader.hpp:40
std::size_t read(unsigned char *buffer, std::size_t n)
Definition GzipFileReader.hpp:51
GzipFileReader(const char *path, const GzipFileReaderOptions &options)
Definition GzipFileReader.hpp:46
Virtual class for reading bytes from a source.
Definition Reader.hpp:17
Simple byte readers and writers.
Definition BufferedReader.hpp:21
Options for GzipFileReader construction.
Definition GzipFileReader.hpp:26
std::optional< unsigned > buffer_size
Definition GzipFileReader.hpp:32