45 bool open(
const std::string& filename,
const char* mode);
60 std::streampos
tell()
const;
64 static const int buffer_size = 1024*64;
75 virtual int_type
pbackfail(int_type c)
override;
76 virtual std::streamsize
showmanyc()
override;
77 virtual std::streamsize
xsgetn(char_type* s, std::streamsize n)
override;
78 virtual int_type
overflow(int_type c)
override;
79 virtual int sync()
override;
80 virtual std::streamsize
xsputn(
const char_type* s, std::streamsize n)
override;
96 explicit IGZstream(
const std::string& filename);
102 void open(
const std::string& filename);
110 bool is_open()
const {
return buf && buf->is_open(); }
113 std::unique_ptr<GZstreambuf> buf;
130 explicit OGZstream(
const std::string& filename);
136 void open(
const std::string& filename);
144 bool is_open()
const {
return buf && buf->is_open(); }
147 std::unique_ptr<GZstreambuf> buf;
A stream buffer for compressed (gzipped) file I/O using zlib with compression level 9.
Definition GZstream.h:34
bool open(const std::string &filename, const char *mode)
Open a gzipped file.
Definition GZstream.cc:40
virtual std::streamsize showmanyc() override
Definition GZstream.cc:142
virtual int sync() override
Definition GZstream.cc:181
virtual int_type overflow(int_type c) override
Definition GZstream.cc:157
virtual std::streamsize xsputn(const char_type *s, std::streamsize n) override
Definition GZstream.cc:198
void close()
Close the file.
Definition GZstream.cc:60
std::streampos tell() const
Get the current position.
Definition GZstream.cc:84
virtual int_type pbackfail(int_type c) override
Definition GZstream.cc:106
bool is_open() const
Check if the stream is open.
Definition GZstream.cc:79
~GZstreambuf() override
Definition GZstream.cc:34
virtual std::streamsize xsgetn(char_type *s, std::streamsize n) override
Definition GZstream.cc:148
virtual int_type underflow() override
Definition GZstream.cc:91
GZstreambuf()
Definition GZstream.cc:27
A class that provides gzipped input stream functionality using zlib.
Definition GZstream.h:87
~IGZstream() override
Definition GZstream.cc:219
IGZstream()
Definition GZstream.cc:211
void close()
Definition GZstream.cc:237
bool is_open() const
Check if the stream is open.
Definition GZstream.h:110
void open(const std::string &filename)
Open a gzipped file for reading.
Definition GZstream.cc:224
A class that provides gzipped output stream functionality using zlib. Uses compression level 9 (best ...
Definition GZstream.h:121
void open(const std::string &filename)
Open a gzipped file for writing.
Definition GZstream.cc:263
void close()
Definition GZstream.cc:279
OGZstream()
Definition GZstream.cc:250
~OGZstream() override
Definition GZstream.cc:258
bool is_open() const
Check if the stream is open.
Definition GZstream.h:144