36 #if ! defined (octave_zfsstream_h)
37 #define octave_zfsstream_h 1
39 #include "octave-config.h"
41 #if defined (HAVE_ZLIB)
79 int comp_strategy = Z_DEFAULT_STRATEGY);
86 is_open ()
const {
return (m_file !=
nullptr); }
95 open (
const char *name,
96 std::ios_base::openmode mode);
106 std::ios_base::openmode mode);
131 virtual std::streamsize
154 overflow (int_type c = traits_type::eof ());
164 virtual std::streambuf *
183 seekoff (off_type off, std::ios_base::seekdir way,
184 std::ios_base::openmode mode =
185 std::ios_base::in | std::ios_base::out);
193 seekpos (pos_type sp, std::ios_base::openmode mode =
194 std::ios_base::in | std::ios_base::out);
197 pbackfail (int_type c = traits_type::eof ());
236 std::ios_base::openmode m_io_mode;
260 std::streamsize m_buffer_size;
290 std::ios_base::openmode mode = std::ios_base::in);
299 std::ios_base::openmode mode = std::ios_base::in);
306 {
return const_cast<gzfilebuf *
> (&m_sb); }
328 open (
const char *name,
329 std::ios_base::openmode mode = std::ios_base::in);
341 std::ios_base::openmode mode = std::ios_base::in);
377 std::ios_base::openmode mode = std::ios_base::out);
386 std::ios_base::openmode mode = std::ios_base::out);
393 {
return const_cast<gzfilebuf *
> (&m_sb); }
415 open (
const char *name,
416 std::ios_base::openmode mode = std::ios_base::out);
428 std::ios_base::openmode mode = std::ios_base::out);
451 template <
typename T1,
typename T2>
456 template <
typename Ta,
typename Tb>
484 template <
typename T1,
typename T2>
489 : m_fcn(
f), m_val1(v1), m_val2(
v2)
493 template <
typename T1,
typename T2>
496 {
return (*
m.m_fcn) (s,
m.m_val1,
m.m_val2); }
Gzipped file stream buffer class.
gzfilebuf * close()
Close gzipped file.
bool is_open() const
Check if file is open.
virtual int_type underflow()
Fill get area from gzipped file.
virtual int_type overflow(int_type c=traits_type::eof())
Write put area to gzipped file.
virtual pos_type seekoff(off_type off, std::ios_base::seekdir way, std::ios_base::openmode mode=std::ios_base::in|std::ios_base::out)
Alters the stream positions.
virtual int_type pbackfail(int_type c=traits_type::eof())
virtual std::streambuf * setbuf(char_type *p, std::streamsize n)
Installs external stream buffer.
gzfilebuf * open(const char *name, std::ios_base::openmode mode)
Open gzipped file.
virtual pos_type seekpos(pos_type sp, std::ios_base::openmode mode=std::ios_base::in|std::ios_base::out)
Alters the stream positions.
bool open_mode(std::ios_base::openmode mode, char *c_mode) const
Convert ios open mode int to mode string used by zlib.
int setcompression(int comp_level, int comp_strategy=Z_DEFAULT_STRATEGY)
Set compression level and strategy on the fly.
virtual int sync()
Flush stream buffer to file.
gzfilebuf * attach(int fd, std::ios_base::openmode mode)
Attach to already open gzipped file.
virtual std::streamsize showmanyc()
Number of characters available in stream buffer.
Gzipped file input stream class.
void close()
Close gzipped file.
gzfilebuf * rdbuf() const
Obtain underlying stream buffer.
void attach(int fd, std::ios_base::openmode mode=std::ios_base::in)
Attach to already open gzipped file.
void open(const char *name, std::ios_base::openmode mode=std::ios_base::in)
Open gzipped file.
bool is_open()
Check if file is open.
Gzipped file output stream class.
gzfilebuf * rdbuf() const
Obtain underlying stream buffer.
void close()
Close gzipped file.
void attach(int fd, std::ios_base::openmode mode=std::ios_base::out)
Attach to already open gzipped file.
bool is_open()
Check if file is open.
void open(const char *name, std::ios_base::openmode mode=std::ios_base::out)
Open gzipped file.
Gzipped file output stream manipulator class.
friend gzofstream & operator<<(gzofstream &, const gzomanip2< Ta, Tb > &)
gzomanip2(gzofstream &(*f)(gzofstream &, T1, T2), T1 v1, T2 v2)
gzofstream & operator<<(gzofstream &s, const gzomanip2< T1, T2 > &m)
gzofstream & setcompression(gzofstream &gzs, int l, int s=Z_DEFAULT_STRATEGY)
F77_RET_T const F77_DBLE const F77_DBLE * f
const octave_char_matrix & v2