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; }
66 BUF_T *rdbuf (
void)
const
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) { }
114 create (
const std::string& n, FILE *
f = 0,
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,