Mercurial > octave
comparison libinterp/corefcn/oct-stdstrm.h @ 30172:dbfa0f70d9bd
maint: use "m_" prefix for member variables in class tstdiostream.
* oct-stdstrm.h: Use "m_" prefix for member variables in class tstdiostream.
author | Rik <rik@octave.org> |
---|---|
date | Mon, 13 Sep 2021 21:29:14 -0700 |
parents | 3988112c7116 |
children | 796f54d4ddbf |
comparison
equal
deleted
inserted
replaced
30171:7bac3fb3d6b6 | 30172:dbfa0f70d9bd |
---|---|
45 std::ios::openmode m = std::ios::in | std::ios::out, | 45 std::ios::openmode m = std::ios::in | std::ios::out, |
46 mach_info::float_format ff = mach_info::native_float_format (), | 46 mach_info::float_format ff = mach_info::native_float_format (), |
47 const std::string& encoding = "utf-8", | 47 const std::string& encoding = "utf-8", |
48 typename BUF_T::close_fcn cf = BUF_T::file_close) | 48 typename BUF_T::close_fcn cf = BUF_T::file_close) |
49 : base_stream (m, ff, encoding), m_name (n), m_mode (m), | 49 : base_stream (m, ff, encoding), m_name (n), m_mode (m), |
50 m_stream (f ? new STREAM_T (f, cf) : nullptr), fnum (fid) | 50 m_stream (f ? new STREAM_T (f, cf) : nullptr), m_fnum (fid) |
51 { } | 51 { } |
52 | 52 |
53 // No copying! | 53 // No copying! |
54 | 54 |
55 tstdiostream (const tstdiostream&) = delete; | 55 tstdiostream (const tstdiostream&) = delete; |
89 BUF_T * rdbuf (void) const | 89 BUF_T * rdbuf (void) const |
90 { | 90 { |
91 return m_stream ? (const_cast<STREAM_T *> (m_stream))->rdbuf () : nullptr; | 91 return m_stream ? (const_cast<STREAM_T *> (m_stream))->rdbuf () : nullptr; |
92 } | 92 } |
93 | 93 |
94 int file_number (void) const { return fnum; } | 94 int file_number (void) const { return m_fnum; } |
95 | 95 |
96 bool bad (void) const { return m_stream ? m_stream->bad () : true; } | 96 bool bad (void) const { return m_stream ? m_stream->bad () : true; } |
97 | 97 |
98 void clear (void) | 98 void clear (void) |
99 { | 99 { |
107 m_stream->stream_close (); | 107 m_stream->stream_close (); |
108 } | 108 } |
109 | 109 |
110 protected: | 110 protected: |
111 | 111 |
112 ~tstdiostream (void) { delete m_stream; } | |
113 | |
114 //-------- | |
115 | |
112 std::string m_name; | 116 std::string m_name; |
113 | 117 |
114 std::ios::openmode m_mode; | 118 std::ios::openmode m_mode; |
115 | 119 |
116 STREAM_T *m_stream; | 120 STREAM_T *m_stream; |
117 | 121 |
118 // The file number associated with this file. | 122 // The file number associated with this file. |
119 int fnum; | 123 int m_fnum; |
120 | |
121 ~tstdiostream (void) { delete m_stream; } | |
122 }; | 124 }; |
123 | 125 |
124 class | 126 class |
125 stdiostream | 127 stdiostream |
126 : public tstdiostream<c_file_ptr_buf, io_c_file_ptr_stream, FILE *> | 128 : public tstdiostream<c_file_ptr_buf, io_c_file_ptr_stream, FILE *> |