23 #if !defined (octave_oct_stdstrm_h)
24 #define octave_oct_stdstrm_h 1
29 template <
typename BUF_T,
typename STREAM_T,
typename FILE_T>
36 std::ios::openmode m = std::ios::in|std::ios::out,
46 int seek (off_t offset,
int origin)
47 {
return s ? s->seek (offset, origin) : -1; }
51 off_t
tell (
void) {
return s ? s->tell () : -1; }
55 bool eof (
void)
const {
return s ? s->eof () :
true; }
59 std::string
name (
void)
const {
return nm; }
61 std::istream *
input_stream (
void) {
return (md & std::ios::in) ? s : 0; }
63 std::ostream *
output_stream (
void) {
return (md & std::ios::out) ? s : 0; }
67 {
return s ? (
const_cast<STREAM_T *
> (s))->rdbuf () : 0; }
71 bool bad (
void)
const {
return s ? s->bad () :
true; }
73 void clear (
void) {
if (s) s->clear (); }
75 void do_close (
void) {
if (s) s->stream_close (); }
81 std::ios::openmode
md;
106 std::ios::openmode m = std::ios::in|std::ios::out,
111 (n,
f,
f ? fileno (
f) : -1, m, ff, cf) { }
115 std::ios::openmode m = std::ios::in|std::ios::out,
145 std::ios::openmode m = std::ios::in|std::ios::out,
151 (n,
f, fid, m, ff, cf) { }
154 create (
const std::string& n, gzFile
f = 0,
int fid = 0,
155 std::ios::openmode m = std::ios::in|std::ios::out,
static int file_close(gzFile f)
std::string name(void) const
int seek(off_t offset, int origin)
octave_tstdiostream(const std::string &n, FILE_T f=0, int fid=0, std::ios::openmode m=std::ios::in|std::ios::out, oct_mach_info::float_format ff=oct_mach_info::native_float_format(), typename BUF_T::close_fcn cf=BUF_T::file_close)
int file_number(void) const
std::istream * input_stream(void)
~octave_stdiostream(void)
~octave_tstdiostream(void)
static octave_stream create(const std::string &n, gzFile f=0, int fid=0, std::ios::openmode m=std::ios::in|std::ios::out, oct_mach_info::float_format ff=oct_mach_info::native_float_format(), c_zfile_ptr_buf::close_fcn cf=c_zfile_ptr_buf::file_close)
octave_stdiostream(const std::string &n, FILE *f=0, std::ios::openmode m=std::ios::in|std::ios::out, oct_mach_info::float_format ff=oct_mach_info::native_float_format(), c_file_ptr_buf::close_fcn cf=c_file_ptr_buf::file_close)
static void close_fcn(FILE *f)
F77_RET_T const double const double * f
std::ostream * output_stream(void)
static octave_stream create(const std::string &n, FILE *f=0, std::ios::openmode m=std::ios::in|std::ios::out, oct_mach_info::float_format ff=oct_mach_info::native_float_format(), c_file_ptr_buf::close_fcn cf=c_file_ptr_buf::file_close)
~octave_zstdiostream(void)
static int file_close(FILE *f)
static float_format native_float_format(void)
octave_zstdiostream(const std::string &n, gzFile f=0, int fid=0, std::ios::openmode m=std::ios::in|std::ios::out, oct_mach_info::float_format ff=oct_mach_info::native_float_format(), c_zfile_ptr_buf::close_fcn cf=c_zfile_ptr_buf::file_close)
BUF_T * rdbuf(void) const