changeset 27166:92ba3434f0b0

style fixes and member variable updates for oct-stdstrm.h * oct-stdstrm.h: Use m_ prefix and clearer names for member variables. Style fixes.
author John W. Eaton <jwe@octave.org>
date Mon, 10 Jun 2019 12:44:39 -0500
parents 58bdc2d98481
children ec6d31ef6bb6
files libinterp/corefcn/oct-stdstrm.h
diffstat 1 files changed, 34 insertions(+), 16 deletions(-) [+]
line wrap: on
line diff
--- a/libinterp/corefcn/oct-stdstrm.h	Sat Jun 08 21:17:03 2019 -0700
+++ b/libinterp/corefcn/oct-stdstrm.h	Mon Jun 10 12:44:39 2019 -0500
@@ -42,8 +42,8 @@
                          = octave::mach_info::native_float_format (),
                        const std::string& encoding = "utf-8",
                        typename BUF_T::close_fcn cf = BUF_T::file_close)
-    : octave::base_stream (m, ff, encoding), nm (n), md (m),
-      s (f ? new STREAM_T (f, cf) : nullptr), fnum (fid)
+    : octave::base_stream (m, ff, encoding), m_name (n), m_mode (m),
+      m_stream (f ? new STREAM_T (f, cf) : nullptr), fnum (fid)
   { }
 
   // No copying!
@@ -55,48 +55,66 @@
   // Position a stream at OFFSET relative to ORIGIN.
 
   int seek (off_t offset, int origin)
-  { return s ? s->seek (offset, origin) : -1; }
+  {
+    return m_stream ? m_stream->seek (offset, origin) : -1;
+  }
 
   // Return current stream position.
 
-  off_t tell (void) { return s ? s->tell () : -1; }
+  off_t tell (void) { return m_stream ? m_stream->tell () : -1; }
 
   // Return nonzero if EOF has been reached on this stream.
 
-  bool eof (void) const { return s ? s->eof () : true; }
+  bool eof (void) const { return m_stream ? m_stream->eof () : true; }
 
   // The name of the file.
 
-  std::string name (void) const { return nm; }
+  std::string name (void) const { return m_name; }
 
-  std::istream * input_stream (void) { return (md & std::ios::in) ? s : nullptr; }
+  std::istream * input_stream (void)
+  {
+    return (m_mode & std::ios::in) ? m_stream : nullptr;
+  }
 
-  std::ostream * output_stream (void) { return (md & std::ios::out) ? s : nullptr; }
+  std::ostream * output_stream (void)
+  {
+    return (m_mode & std::ios::out) ? m_stream : nullptr;
+  }
 
   // FIXME: should not have to cast away const here.
   BUF_T * rdbuf (void) const
-  { return s ? (const_cast<STREAM_T *> (s))->rdbuf () : nullptr; }
+  {
+    return m_stream ? (const_cast<STREAM_T *> (m_stream))->rdbuf () : nullptr;
+  }
 
   int file_number (void) const { return fnum; }
 
-  bool bad (void) const { return s ? s->bad () : true; }
+  bool bad (void) const { return m_stream ? m_stream->bad () : true; }
 
-  void clear (void) { if (s) s->clear (); }
+  void clear (void)
+  {
+    if (m_stream)
+      m_stream->clear ();
+  }
 
-  void do_close (void) { if (s) s->stream_close (); }
+  void do_close (void)
+  {
+    if (m_stream)
+      m_stream->stream_close ();
+  }
 
 protected:
 
-  std::string nm;
+  std::string m_name;
 
-  std::ios::openmode md;
+  std::ios::openmode m_mode;
 
-  STREAM_T *s;
+  STREAM_T *m_stream;
 
   // The file number associated with this file.
   int fnum;
 
-  ~octave_tstdiostream (void) { delete s; }
+  ~octave_tstdiostream (void) { delete m_stream; }
 };
 
 class