23 #if ! defined (octave_oct_stdstrm_h) 24 #define octave_oct_stdstrm_h 1 26 #include "octave-config.h" 31 template <
typename BUF_T,
typename STREAM_T,
typename FILE_T>
38 std::ios::openmode m = std::ios::in | std::ios::out,
42 :
octave::base_stream (m, ff),
nm (n), md (m),
54 int seek (off_t offset,
int origin)
55 {
return s ?
s->seek (offset, origin) : -1; }
59 off_t
tell (
void) {
return s ?
s->tell () : -1; }
63 bool eof (
void)
const {
return s ?
s->eof () :
true; }
69 std::istream *
input_stream (
void) {
return (md & std::ios::in) ?
s :
nullptr; }
71 std::ostream *
output_stream (
void) {
return (md & std::ios::out) ?
s :
nullptr; }
75 {
return s ? (
const_cast<STREAM_T *
> (
s))->rdbuf () :
nullptr; }
79 bool bad (
void)
const {
return s ?
s->bad () :
true; }
89 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,
134 #if defined (HAVE_ZLIB) 143 std::ios::openmode m = std::ios::in | std::ios::out,
149 (n,
f,
fid, m, ff, cf) { }
153 std::ios::openmode m = std::ios::in | std::ios::out,
static int file_close(gzFile f)
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 const F77_DBLE F77_DBLE &F77_RET_T const F77_REAL F77_REAL &F77_RET_T const F77_DBLE const F77_DBLE * f
int seek(off_t offset, int origin)
std::istream * input_stream(void)
octave_stdiostream(const std::string &n, FILE *f=nullptr, std::ios::openmode m=std::ios::in|std::ios::out, octave::mach_info::float_format ff=octave::mach_info::native_float_format(), c_file_ptr_buf::close_fcn cf=c_file_ptr_buf::file_close)
~octave_tstdiostream(void)
static void close_fcn(FILE *f)
OCTAVE_EXPORT octave_value_list isdir nd deftypefn *std::string nm
static octave::stream create(const std::string &n, gzFile f=nullptr, int fid=0, std::ios::openmode m=std::ios::in|std::ios::out, octave::mach_info::float_format ff=octave::mach_info::native_float_format(), c_zfile_ptr_buf::close_fcn cf=c_zfile_ptr_buf::file_close)
std::ostream * output_stream(void)
float_format native_float_format(void)
std::string name(void) const
static int file_close(FILE *f)
octave_tstdiostream(const std::string &n, FILE_T f=0, int fid=0, std::ios::openmode m=std::ios::in|std::ios::out, octave::mach_info::float_format ff=octave::mach_info::native_float_format(), typename BUF_T::close_fcn cf=BUF_T::file_close)
int file_number(void) const
octave_zstdiostream(const std::string &n, gzFile f=nullptr, int fid=0, std::ios::openmode m=std::ios::in|std::ios::out, octave::mach_info::float_format ff=octave::mach_info::native_float_format(), c_zfile_ptr_buf::close_fcn cf=c_zfile_ptr_buf::file_close)
static octave::stream create(const std::string &n, FILE *f=nullptr, std::ios::openmode m=std::ios::in|std::ios::out, octave::mach_info::float_format ff=octave::mach_info::native_float_format(), c_file_ptr_buf::close_fcn cf=c_file_ptr_buf::file_close)
If this string is the system will ring the terminal sometimes it is useful to be able to print the original representation of the string
BUF_T * rdbuf(void) const