Mercurial > octave
diff libinterp/corefcn/c-file-ptr-stream.h @ 29991:3988112c7116
move i/o stream classes inside octave namespace
* c-file-ptr-stream.h, c-file-ptr-stream.cc, file-io.cc, oct-fstrm.cc,
oct-fstrm.h, oct-iostrm.cc, oct-iostrm.h, oct-prcstrm.cc,
oct-prcstrm.h, oct-procbuf.cc, oct-procbuf.h, oct-stdstrm.h,
oct-stream.cc, oct-strstrm.cc, oct-strstrm.h, procstream.cc,
procstream.h: Move classes inside octave namespace. Change all
uses. Provide deprecated typedefs to preserve old names where
possible.
author | John W. Eaton <jwe@octave.org> |
---|---|
date | Tue, 17 Aug 2021 11:17:36 -0400 |
parents | 0a5b15007766 |
children | 8dd5da409418 |
line wrap: on
line diff
--- a/libinterp/corefcn/c-file-ptr-stream.h Mon Aug 16 22:28:30 2021 -0400 +++ b/libinterp/corefcn/c-file-ptr-stream.h Tue Aug 17 11:17:36 2021 -0400 @@ -31,6 +31,12 @@ #include <cstdio> #include <istream> +#if defined (HAVE_ZLIB_H) +# include <zlib.h> +#endif + +OCTAVE_NAMESPACE_BEGIN + class c_file_ptr_buf : public std::streambuf { @@ -141,12 +147,9 @@ typedef c_file_ptr_stream<std::iostream, FILE *, c_file_ptr_buf> io_c_file_ptr_stream; + #if defined (HAVE_ZLIB) -#if defined (HAVE_ZLIB_H) -# include <zlib.h> -#endif - class c_zfile_ptr_buf : public std::streambuf { @@ -225,4 +228,41 @@ #endif +OCTAVE_NAMESPACE_END + +#if defined (OCTAVE_PROVIDE_DEPRECATED_SYMBOLS) + +OCTAVE_DEPRECATED (7, "use 'octave::i_c_file_ptr_stream' instead") +typedef octave::i_c_file_ptr_stream i_c_file_ptr_stream; + +OCTAVE_DEPRECATED (7, "use 'octave::o_c_file_ptr_stream' instead") +typedef octave::o_c_file_ptr_stream o_c_file_ptr_stream; + +OCTAVE_DEPRECATED (7, "use 'octave::io_c_file_ptr_stream' instead") +typedef octave::io_c_file_ptr_stream io_c_file_ptr_stream; + +// FIXME: HAVE_ZLIB is not defined here because we do not (and should +// not) include config.h in this header file. We need to find a way to +// define this interface without exposing gzFile. Should this be a +// private header that can only be used if included after config.h in an +// Octave source file and not inside another header file? + +# if defined (HAVE_ZLIB) + +OCTAVE_DEPRECATED (7, "use 'octave::i_c_zfile_ptr_stream' instead") +typedef octave::c_file_ptr_stream<std::istream, gzFile, octave::c_zfile_ptr_buf> + i_c_zfile_ptr_stream; + +OCTAVE_DEPRECATED (7, "use 'octave::o_c_zfile_ptr_stream' instead") +typedef octave::c_file_ptr_stream<std::ostream, gzFile, octave::c_zfile_ptr_buf> + o_c_zfile_ptr_stream; + +OCTAVE_DEPRECATED (7, "use 'octave::io_c_zfile_ptr_stream' instead") +typedef octave::c_file_ptr_stream<std::iostream, gzFile, octave::c_zfile_ptr_buf> + io_c_zfile_ptr_stream; + +# endif + #endif + +#endif