comparison libinterp/corefcn/oct-fstrm.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 796f54d4ddbf
comparison
equal deleted inserted replaced
29990:b839c36fd106 29991:3988112c7116
31 #include <fstream> 31 #include <fstream>
32 #include <string> 32 #include <string>
33 33
34 #include "oct-stream.h" 34 #include "oct-stream.h"
35 35
36 OCTAVE_NAMESPACE_BEGIN
37
36 class 38 class
37 octave_fstream : public octave::base_stream 39 fstream : public base_stream
38 { 40 {
39 public: 41 public:
40 42
41 octave_fstream (const std::string& nm_arg, 43 fstream (const std::string& nm_arg,
42 std::ios::openmode arg_md = std::ios::in | std::ios::out, 44 std::ios::openmode arg_md = std::ios::in | std::ios::out,
43 octave::mach_info::float_format flt_fmt 45 mach_info::float_format flt_fmt = mach_info::native_float_format ());
44 = octave::mach_info::native_float_format ());
45 46
46 // No copying! 47 // No copying!
47 48
48 octave_fstream (const octave_fstream&) = delete; 49 fstream (const fstream&) = delete;
49 50
50 octave_fstream& operator = (const octave_fstream&) = delete; 51 fstream& operator = (const fstream&) = delete;
51 52
52 static octave::stream 53 static stream
53 create (const std::string& nm_arg, 54 create (const std::string& nm_arg,
54 std::ios::openmode arg_md = std::ios::in | std::ios::out, 55 std::ios::openmode arg_md = std::ios::in | std::ios::out,
55 octave::mach_info::float_format flt_fmt 56 mach_info::float_format flt_fmt = mach_info::native_float_format ());
56 = octave::mach_info::native_float_format ());
57 57
58 // Position a stream at OFFSET relative to ORIGIN. 58 // Position a stream at OFFSET relative to ORIGIN.
59 59
60 int seek (off_t offset, int origin); 60 int seek (off_t offset, int origin);
61 61
77 77
78 std::ostream * output_stream (void); 78 std::ostream * output_stream (void);
79 79
80 protected: 80 protected:
81 81
82 ~octave_fstream (void) = default; 82 ~fstream (void) = default;
83 83
84 private: 84 private:
85 85
86 std::string m_name; 86 std::string m_name;
87 87
88 std::fstream m_fstream; 88 std::fstream m_fstream;
89 }; 89 };
90 90
91 OCTAVE_NAMESPACE_END
92
93 #if defined (OCTAVE_PROVIDE_DEPRECATED_SYMBOLS)
94
95 OCTAVE_DEPRECATED (7, "use 'octave::fstream' instead")
96 typedef octave::fstream octave_fstream;
97
91 #endif 98 #endif
99
100 #endif