23 #if ! defined (octave_c_file_ptr_stream_h)
24 #define octave_c_file_ptr_stream_h 1
26 #include "octave-config.h"
44 :
std::streambuf (),
f (f_arg), cf (cf_arg)
49 int_type overflow (int_type);
51 int_type
underflow (
void) {
return underflow_common (
false); }
53 int_type
uflow (
void) {
return underflow_common (
true); }
55 int_type pbackfail (int_type);
57 std::streamsize xsputn (
const char*, std::streamsize);
59 std::streamsize xsgetn (
char *, std::streamsize);
61 std::streampos seekoff (std::streamoff, std::ios::seekdir,
62 std::ios::openmode = std::ios::in | std::ios::out);
64 std::streampos seekpos (std::streampos,
65 std::ios::openmode = std::ios::in | std::ios::out);
75 int seek (off_t offset,
int origin);
79 void clear (
void) {
if (
f) clearerr (
f); }
81 static int file_close (FILE *
f);
91 int_type underflow_common (
bool);
102 template <
typename STREAM_T,
typename FILE_T,
typename BUF_T>
109 :
STREAM_T (0), buf (new BUF_T (f, cf)) { STREAM_T::init (buf); }
117 int seek (off_t offset,
int origin)
118 {
return buf ? buf->seek (offset, origin) : -1; }
120 off_t
tell (
void) {
return buf ? buf->tell () : -1; }
142 #if defined (HAVE_ZLIB)
144 #if defined (HAVE_ZLIB_H)
160 :
std::streambuf (),
f (f_arg), cf (cf_arg)
165 int_type overflow (int_type);
167 int_type
underflow (
void) {
return underflow_common (
false); }
169 int_type
uflow (
void) {
return underflow_common (
true); }
171 int_type pbackfail (int_type);
173 std::streamsize xsputn (
const char*, std::streamsize);
175 std::streamsize xsgetn (
char *, std::streamsize);
177 std::streampos seekoff (std::streamoff, std::ios::seekdir,
178 std::ios::openmode = std::ios::in | std::ios::out);
180 std::streampos seekpos (std::streampos,
181 std::ios::openmode = std::ios::in | std::ios::out);
187 int buf_close (
void);
191 int seek (off_t offset,
int origin)
192 {
return f ? gzseek (
f, offset, origin) >= 0 : -1; }
194 off_t
tell (
void) {
return f ? gztell (
f) : -1; }
208 int_type underflow_common (
bool);
static int file_close(gzFile f)
c_file_ptr_stream< std::ostream, gzFile, c_zfile_ptr_buf > o_c_zfile_ptr_stream
c_file_ptr_stream< std::iostream, gzFile, c_zfile_ptr_buf > io_c_zfile_ptr_stream
F77_RET_T F77_REAL &F77_RET_T F77_DBLE &F77_RET_T F77_REAL &F77_RET_T F77_DBLE &F77_RET_T F77_REAL &F77_RET_T F77_DBLE &F77_RET_T const F77_REAL const F77_REAL F77_REAL &F77_RET_T const F77_DBLE const F77_DBLE F77_DBLE &F77_RET_T F77_REAL &F77_RET_T F77_DBLE &F77_RET_T F77_DBLE &F77_RET_T F77_REAL &F77_RET_T F77_REAL &F77_RET_T F77_DBLE &F77_RET_T const F77_DBLE F77_DBLE &F77_RET_T const F77_REAL F77_REAL &F77_RET_T F77_REAL F77_REAL &F77_RET_T F77_DBLE F77_DBLE &F77_RET_T const F77_DBLE const F77_DBLE * f
c_file_ptr_stream< std::istream, gzFile, c_zfile_ptr_buf > i_c_zfile_ptr_stream
c_file_ptr_stream< std::istream, FILE *, c_file_ptr_buf > i_c_file_ptr_stream
std::streambuf::int_type int_type
int seek(off_t offset, int origin)
c_file_ptr_stream(FILE_T f, typename BUF_T::close_fcn cf=BUF_T::file_close)
c_file_ptr_stream< std::iostream, FILE *, c_file_ptr_buf > io_c_file_ptr_stream
static void close_fcn(FILE *f)
c_zfile_ptr_buf(gzFile f_arg, close_fcn cf_arg=file_close)
c_file_ptr_buf(FILE *f_arg, close_fcn cf_arg=file_close)
c_file_ptr_stream< std::ostream, FILE *, c_file_ptr_buf > o_c_file_ptr_stream
std::streambuf::int_type int_type
int seek(off_t offset, int origin)
static void clear(octave::dynamic_library &oct_file)