Mercurial > hg > octave-nkf
diff src/c-file-ptr-stream.h @ 4797:19b8225bdaa2
[project @ 2004-02-23 22:10:31 by jwe]
author | jwe |
---|---|
date | Mon, 23 Feb 2004 22:10:32 +0000 |
parents | 1cae4472c624 |
children | 4a796c5fc7a3 |
line wrap: on
line diff
--- a/src/c-file-ptr-stream.h +++ b/src/c-file-ptr-stream.h @@ -43,7 +43,7 @@ typedef int (*close_fcn) (FILE *); - FILE* stdiofile (void) const { return f; } + FILE* stdiofile (void) { return f; } c_file_ptr_buf (FILE *f_arg, close_fcn cf_arg = fclose) : std::streambuf (), f (f_arg), cf (cf_arg) @@ -77,6 +77,11 @@ int file_number () const { return f ? fileno (f) : -1; } + int seek (long offset, int origin) + { return f ? fseek (f, offset, origin) : -1; } + + long tell (void) { return f ? ftell (f) : -1; } + static int fclose (FILE *f) { return ::fclose (f); } protected: @@ -105,6 +110,11 @@ void close (void) { if (buf) buf->close (); } + int seek (long offset, int origin) + { return buf ? buf->seek (offset, origin) : -1; } + + long tell (void) { return buf ? buf->tell () : -1; } + private: c_file_ptr_buf *buf; @@ -125,6 +135,11 @@ void close (void) { if (buf) buf->close (); } + int seek (long offset, int origin) + { return buf ? buf->seek (offset, origin) : -1; } + + long tell (void) { return buf ? buf->tell () : -1; } + private: c_file_ptr_buf *buf; @@ -145,6 +160,11 @@ void close (void) { if (buf) buf->close (); } + int seek (long offset, int origin) + { return buf ? buf->seek (offset, origin) : -1; } + + long tell (void) { return buf ? buf->tell () : -1; } + private: c_file_ptr_buf *buf;