36 #if ! defined (octave_zfsstream_h)
37 #define octave_zfsstream_h 1
39 #include "octave-config.h"
41 #if defined (HAVE_ZLIB)
83 int comp_strategy = Z_DEFAULT_STRATEGY);
100 std::ios_base::openmode mode);
110 std::ios_base::openmode mode);
135 virtual std::streamsize
158 overflow (int_type c = traits_type::eof ());
168 virtual std::streambuf*
187 seekoff (off_type off, std::ios_base::seekdir way,
188 std::ios_base::openmode mode =
189 std::ios_base::in | std::ios_base::out);
197 seekpos (pos_type sp, std::ios_base::openmode mode =
198 std::ios_base::in | std::ios_base::out);
201 pbackfail (int_type c = traits_type::eof ());
294 std::ios_base::openmode mode = std::ios_base::in);
303 std::ios_base::openmode mode = std::ios_base::in);
333 std::ios_base::openmode mode = std::ios_base::in);
345 std::ios_base::openmode mode = std::ios_base::in);
381 std::ios_base::openmode mode = std::ios_base::out);
390 std::ios_base::openmode mode = std::ios_base::out);
420 std::ios_base::openmode mode = std::ios_base::out);
432 std::ios_base::openmode mode = std::ios_base::out);
455 template <
typename T1,
typename T2>
460 template <
typename Ta,
typename Tb>
488 template <
typename T1,
typename T2>
493 : func(
f), val1(v1), val2(
v2)
497 template <
typename T1,
typename T2>
500 {
return (*
m.func)(s,
m.val1,
m.val2); }
Gzipped file stream buffer class.
std::streamsize buffer_size
Stream buffer size.
gzfilebuf(const gzfilebuf &)=delete
gzfilebuf * close()
Close gzipped file.
gzFile file
Underlying file pointer.
bool is_open() const
Check if file is open.
virtual int_type underflow()
Fill get area from gzipped file.
std::ios_base::openmode io_mode
Mode in which file was opened.
bool own_fd
True if this object owns file descriptor.
virtual int_type overflow(int_type c=traits_type::eof())
Write put area to gzipped file.
gzfilebuf & operator=(const gzfilebuf &)=delete
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.
void disable_buffer()
Destroy internal buffer.
gzfilebuf * open(const char *name, std::ios_base::openmode mode)
Open gzipped file.
char_type * buffer
Stream buffer.
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.
bool own_buffer
True if this object owns stream buffer.
int setcompression(int comp_level, int comp_strategy=Z_DEFAULT_STRATEGY)
Set compression level and strategy on the fly.
void enable_buffer()
Allocate internal buffer.
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.
gzfilebuf sb
Underlying stream buffer.
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.
gzfilebuf sb
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)
F77_RET_T const F77_DBLE const F77_DBLE * f
const octave_char_matrix & v2
gzofstream & operator<<(gzofstream &s, const gzomanip2< T1, T2 > &m)
gzofstream & setcompression(gzofstream &gzs, int l, int s=Z_DEFAULT_STRATEGY)