# HG changeset patch # User John W. Eaton # Date 1560275635 18000 # Node ID b0abae0bd94bf81d1eee048894eb04a1f9200872 # Parent 196dfb42f3e9bd026da8a61b021fa025bd8e896f style fixes * oct-fstrm.cc, oct-fstrm.h, oct-iostrm.cc, oct-iostrm.h, oct-stream.cc, oct-stream.h, oct-strstrm.h, procstream.cc, procstream.h: Use m_ prefix for member variable names and other minor style fixes. diff -r 196dfb42f3e9 -r b0abae0bd94b libinterp/corefcn/oct-fstrm.cc --- a/libinterp/corefcn/oct-fstrm.cc Tue Jun 11 12:50:34 2019 -0500 +++ b/libinterp/corefcn/oct-fstrm.cc Tue Jun 11 12:53:55 2019 -0500 @@ -40,11 +40,11 @@ octave_fstream::octave_fstream (const std::string& nm_arg, std::ios::openmode arg_md, octave::mach_info::float_format ff) - : octave::base_stream (arg_md, ff), nm (nm_arg) + : octave::base_stream (arg_md, ff), m_name (nm_arg) { - fs.open (nm.c_str (), arg_md); + m_fstream.open (m_name.c_str (), arg_md); - if (! fs) + if (! m_fstream) // Note: error is inherited from octave::base_stream, not ::error. error (std::strerror (errno)); } @@ -76,13 +76,13 @@ bool octave_fstream::eof (void) const { - return fs.eof (); + return m_fstream.eof (); } void octave_fstream::do_close (void) { - fs.close (); + m_fstream.close (); } std::istream * @@ -91,7 +91,7 @@ std::istream *retval = nullptr; if (mode () & std::ios::in) - retval = &fs; + retval = &m_fstream; return retval; } @@ -102,7 +102,7 @@ std::ostream *retval = nullptr; if (mode () & std::ios::out) - retval = &fs; + retval = &m_fstream; return retval; } diff -r 196dfb42f3e9 -r b0abae0bd94b libinterp/corefcn/oct-fstrm.h --- a/libinterp/corefcn/oct-fstrm.h Tue Jun 11 12:50:34 2019 -0500 +++ b/libinterp/corefcn/oct-fstrm.h Tue Jun 11 12:53:55 2019 -0500 @@ -68,7 +68,7 @@ // 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); @@ -80,9 +80,9 @@ private: - std::string nm; + std::string m_name; - std::fstream fs; + std::fstream m_fstream; }; #endif diff -r 196dfb42f3e9 -r b0abae0bd94b libinterp/corefcn/oct-iostrm.cc --- a/libinterp/corefcn/oct-iostrm.cc Tue Jun 11 12:50:34 2019 -0500 +++ b/libinterp/corefcn/oct-iostrm.cc Tue Jun 11 12:53:55 2019 -0500 @@ -69,7 +69,7 @@ bool octave_istream::eof (void) const { - return is && is->eof (); + return m_istream && m_istream->eof (); } octave::stream @@ -83,7 +83,7 @@ bool octave_ostream::eof (void) const { - return os && os->eof (); + return m_ostream && m_ostream->eof (); } octave::stream diff -r 196dfb42f3e9 -r b0abae0bd94b libinterp/corefcn/oct-iostrm.h --- a/libinterp/corefcn/oct-iostrm.h Tue Jun 11 12:50:34 2019 -0500 +++ b/libinterp/corefcn/oct-iostrm.h Tue Jun 11 12:53:55 2019 -0500 @@ -38,7 +38,7 @@ std::ios::openmode m = std::ios::in | std::ios::out, octave::mach_info::float_format ff = octave::mach_info::native_float_format ()) - : octave::base_stream (m, ff), nm (n) { } + : octave::base_stream (m, ff), m_name (n) { } // No copying! @@ -66,7 +66,7 @@ // The name of the file. - std::string name (void) const { return nm; } + std::string name (void) const { return m_name; } protected: @@ -74,7 +74,7 @@ private: - std::string nm; + std::string m_name; virtual const char * stream_type (void) const = 0; }; @@ -87,7 +87,7 @@ octave_istream (std::istream *arg = nullptr, const std::string& n = "") : octave_base_iostream (n, std::ios::in, octave::mach_info::native_float_format ()), - is (arg) + m_istream (arg) { } static octave::stream @@ -97,7 +97,7 @@ bool eof (void) const; - std::istream * input_stream (void) { return is; } + std::istream * input_stream (void) { return m_istream; } std::ostream * output_stream (void) { return nullptr; } @@ -107,7 +107,7 @@ private: - std::istream *is; + std::istream *m_istream; const char * stream_type (void) const { return "octave_istream"; } @@ -126,7 +126,7 @@ octave_ostream (std::ostream *arg, const std::string& n = "") : octave_base_iostream (n, std::ios::out, octave::mach_info::native_float_format ()), - os (arg) + m_ostream (arg) { } static octave::stream @@ -138,7 +138,7 @@ std::istream * input_stream (void) { return nullptr; } - std::ostream * output_stream (void) { return os; } + std::ostream * output_stream (void) { return m_ostream; } protected: @@ -146,7 +146,7 @@ private: - std::ostream *os; + std::ostream *m_ostream; const char * stream_type (void) const { return "octave_ostream"; } diff -r 196dfb42f3e9 -r b0abae0bd94b libinterp/corefcn/oct-stream.cc --- a/libinterp/corefcn/oct-stream.cc Tue Jun 11 12:50:34 2019 -0500 +++ b/libinterp/corefcn/oct-stream.cc Tue Jun 11 12:53:55 2019 -0500 @@ -3972,22 +3972,22 @@ void base_stream::error (const std::string& msg) { - fail = true; - errmsg = msg; + m_fail = true; + m_errmsg = msg; } void base_stream::error (const std::string& who, const std::string& msg) { - fail = true; - errmsg = who + ": " + msg; + m_fail = true; + m_errmsg = who + ": " + msg; } void base_stream::clear (void) { - fail = false; - errmsg = ""; + m_fail = false; + m_errmsg = ""; } void @@ -5995,9 +5995,9 @@ std::string base_stream::error (bool clear_err, int& err_num) { - err_num = (fail ? -1 : 0); - - std::string tmp = errmsg; + err_num = (m_fail ? -1 : 0); + + std::string tmp = m_errmsg; if (clear_err) clear (); @@ -6013,37 +6013,37 @@ } stream::stream (base_stream *bs) - : rep (bs) - { - if (rep) - rep->count = 1; + : m_rep (bs) + { + if (m_rep) + m_rep->m_count = 1; } stream::~stream (void) { - if (rep && --rep->count == 0) - delete rep; + if (m_rep && --m_rep->m_count == 0) + delete m_rep; } stream::stream (const stream& s) - : rep (s.rep) - { - if (rep) - rep->count++; + : m_rep (s.m_rep) + { + if (m_rep) + m_rep->m_count++; } stream& stream::operator = (const stream& s) { - if (rep != s.rep) - { - if (rep && --rep->count == 0) - delete rep; - - rep = s.rep; - - if (rep) - rep->count++; + if (m_rep != s.m_rep) + { + if (m_rep && --m_rep->m_count == 0) + delete m_rep; + + m_rep = s.m_rep; + + if (m_rep) + m_rep->m_count++; } return *this; @@ -6055,7 +6055,7 @@ int retval = -1; if (stream_ok ()) - retval = rep->flush (); + retval = m_rep->flush (); return retval; } @@ -6066,7 +6066,7 @@ std::string retval; if (stream_ok ()) - retval = rep->getl (max_len, err, who); + retval = m_rep->getl (max_len, err, who); return retval; } @@ -6101,7 +6101,7 @@ std::string retval; if (stream_ok ()) - retval = rep->gets (max_len, err, who); + retval = m_rep->gets (max_len, err, who); return retval; } @@ -6136,7 +6136,7 @@ off_t retval = -1; if (stream_ok ()) - retval = rep->skipl (count, err, who); + retval = m_rep->skipl (count, err, who); return retval; } @@ -6181,31 +6181,31 @@ clearerr (); // Find current position so we can return to it if needed. - off_t orig_pos = rep->tell (); + off_t orig_pos = m_rep->tell (); // Move to end of file. If successful, find the offset of the end. - status = rep->seek (0, SEEK_END); + status = m_rep->seek (0, SEEK_END); if (status == 0) { - off_t eof_pos = rep->tell (); + off_t eof_pos = m_rep->tell (); if (origin == SEEK_CUR) { // Move back to original position, otherwise we will be seeking // from the end of file which is probably not the original // location. - rep->seek (orig_pos, SEEK_SET); + m_rep->seek (orig_pos, SEEK_SET); } // Attempt to move to desired position; may be outside bounds of // existing file. - status = rep->seek (offset, origin); + status = m_rep->seek (offset, origin); if (status == 0) { // Where are we after moving to desired position? - off_t desired_pos = rep->tell (); + off_t desired_pos = m_rep->tell (); // I don't think save_pos can be less than zero, // but we'll check anyway... @@ -6213,7 +6213,7 @@ { // Seek outside bounds of file. // Failure should leave position unchanged. - rep->seek (orig_pos, SEEK_SET); + m_rep->seek (orig_pos, SEEK_SET); status = -1; } @@ -6222,7 +6222,7 @@ { // Seeking to the desired position failed. // Move back to original position and return failure status. - rep->seek (orig_pos, SEEK_SET); + m_rep->seek (orig_pos, SEEK_SET); status = -1; } @@ -6294,7 +6294,7 @@ off_t retval = -1; if (stream_ok ()) - retval = rep->tell (); + retval = m_rep->tell (); return retval; } @@ -6311,7 +6311,7 @@ bool retval = false; if (stream_ok ()) - retval = rep->is_open (); + retval = m_rep->is_open (); return retval; } @@ -6320,7 +6320,7 @@ stream::close (void) { if (stream_ok ()) - rep->close (); + m_rep->close (); } // FIXME: maybe these should be defined in lo-ieee.h? @@ -7105,7 +7105,7 @@ octave_value retval; if (stream_ok ()) - retval = rep->scanf (fmt, size, count, who); + retval = m_rep->scanf (fmt, size, count, who); return retval; } @@ -7140,7 +7140,7 @@ octave_value_list retval; if (stream_ok ()) - retval = rep->oscanf (fmt, who); + retval = m_rep->oscanf (fmt, who); return retval; } @@ -7174,7 +7174,7 @@ const std::string& who, octave_idx_type& count) { return (stream_ok () - ? rep->do_textscan (fmt, ntimes, options, who, count) + ? m_rep->do_textscan (fmt, ntimes, options, who, count) : octave_value ()); } @@ -7185,7 +7185,7 @@ int retval = -1; if (stream_ok ()) - retval = rep->printf (fmt, args, who); + retval = m_rep->printf (fmt, args, who); return retval; } @@ -7220,7 +7220,7 @@ int retval = -1; if (stream_ok ()) - retval = rep->puts (s, who); + retval = m_rep->puts (s, who); return retval; } @@ -7252,7 +7252,7 @@ int retval = -1; if (stream_ok ()) - retval = rep->eof (); + retval = m_rep->eof (); return retval; } @@ -7263,7 +7263,7 @@ std::string retval = "invalid stream object"; if (stream_ok (false)) - retval = rep->error (clear, err_num); + retval = m_rep->error (clear, err_num); return retval; } @@ -7274,7 +7274,7 @@ std::string retval; if (stream_ok ()) - retval = rep->name (); + retval = m_rep->name (); return retval; } @@ -7285,7 +7285,7 @@ int retval = 0; if (stream_ok ()) - retval = rep->mode (); + retval = m_rep->mode (); return retval; } @@ -7296,7 +7296,7 @@ mach_info::float_format retval = mach_info::flt_fmt_unknown; if (stream_ok ()) - retval = rep->float_format (); + retval = m_rep->float_format (); return retval; } @@ -7340,7 +7340,7 @@ } stream_list::stream_list (interpreter& interp) - : list (), lookup_cache (list.end ()), m_stdin_file (-1), + : m_list (), m_lookup_cache (m_list.end ()), m_stdin_file (-1), m_stdout_file (-1), m_stderr_file (-1) { stream stdin_stream = octave_istream::create (&std::cin, "stdin"); @@ -7378,8 +7378,8 @@ // Should we test for // - // (list.find (stream_number) != list.end () - // && list[stream_number].is_open ()) + // (m_list.find (stream_number) != m_list.end () + // && m_list[stream_number].is_open ()) // // and respond with "error ("internal error: ...")"? It should not // happen except for some bug or if the user has opened a stream with @@ -7389,10 +7389,10 @@ // overwrite this entry, although the wrong entry might have done harm // before. - if (list.size () >= list.max_size ()) + if (m_list.size () >= m_list.max_size ()) ::error ("could not create file id"); - list[stream_number] = os; + m_list[stream_number] = os; return stream_number; } @@ -7414,17 +7414,17 @@ if (fid < 0) err_invalid_file_id (fid, who); - if (lookup_cache != list.end () && lookup_cache->first == fid) - retval = lookup_cache->second; + if (m_lookup_cache != m_list.end () && m_lookup_cache->first == fid) + retval = m_lookup_cache->second; else { - ostrl_map::const_iterator iter = list.find (fid); - - if (iter == list.end ()) + ostrl_map::const_iterator iter = m_list.find (fid); + + if (iter == m_list.end ()) err_invalid_file_id (fid, who); retval = iter->second; - lookup_cache = iter; + m_lookup_cache = iter; } return retval; @@ -7444,14 +7444,14 @@ if (fid < 3) err_invalid_file_id (fid, who); - auto iter = list.find (fid); - - if (iter == list.end ()) + auto iter = m_list.find (fid); + + if (iter == m_list.end ()) err_invalid_file_id (fid, who); stream os = iter->second; - list.erase (iter); - lookup_cache = list.end (); + m_list.erase (iter); + m_lookup_cache = m_list.end (); // FIXME: is this check redundant? if (! os.is_valid ()) @@ -7487,11 +7487,11 @@ if (flush) { // Flush stdout and stderr. - list[1].flush (); - list[2].flush (); - } - - for (auto iter = list.begin (); iter != list.end (); ) + m_list[1].flush (); + m_list[2].flush (); + } + + for (auto iter = m_list.begin (); iter != m_list.end (); ) { int fid = iter->first; if (fid < 3) // Don't delete stdin, stdout, stderr @@ -7513,14 +7513,14 @@ continue; } - // Normal file handle. Close and delete from list. + // Normal file handle. Close and delete from m_list. if (os.is_valid ()) os.close (); - list.erase (iter++); - } - - lookup_cache = list.end (); + m_list.erase (iter++); + } + + m_lookup_cache = m_list.end (); } string_vector stream_list::get_info (int fid) const @@ -7531,17 +7531,17 @@ return retval; stream os; - if (lookup_cache != list.end () && lookup_cache->first == fid) - os = lookup_cache->second; + if (m_lookup_cache != m_list.end () && m_lookup_cache->first == fid) + os = m_lookup_cache->second; else { - ostrl_map::const_iterator iter = list.find (fid); - - if (iter == list.end ()) + ostrl_map::const_iterator iter = m_list.find (fid); + + if (iter == m_list.end ()) return retval; os = iter->second; - lookup_cache = iter; + m_lookup_cache = iter; } if (! os.is_valid ()) @@ -7578,7 +7578,7 @@ << " number mode arch name\n" << " ------ ---- ---- ----\n"; - for (const auto& fid_strm : list) + for (const auto& fid_strm : m_list) { stream os = fid_strm.second; @@ -7604,11 +7604,11 @@ octave_value stream_list::open_file_numbers (void) const { - Matrix retval (1, list.size (), 0.0); + Matrix retval (1, m_list.size (), 0.0); int num_open = 0; - for (const auto& fid_strm : list) + for (const auto& fid_strm : m_list) { // Skip stdin, stdout, and stderr. if (fid_strm.first > 2 && fid_strm.second) @@ -7628,7 +7628,7 @@ { std::string nm = fid.string_value (); - for (const auto& fid_strm : list) + for (const auto& fid_strm : m_list) { // stdin, stdout, and stderr are unnamed. if (fid_strm.first > 2) diff -r 196dfb42f3e9 -r b0abae0bd94b libinterp/corefcn/oct-stream.h --- a/libinterp/corefcn/oct-stream.h Tue Jun 11 12:50:34 2019 -0500 +++ b/libinterp/corefcn/oct-stream.h Tue Jun 11 12:53:55 2019 -0500 @@ -69,8 +69,8 @@ base_stream (std::ios::openmode arg_md = std::ios::in | std::ios::out, mach_info::float_format ff = mach_info::native_float_format (), const std::string& encoding = "utf-8") - : count (0), md (arg_md), flt_fmt (ff), mencoding (encoding), - fail (false), open_state (true), errmsg () + : m_count (0), m_mode (arg_md), m_flt_fmt (ff), m_encoding (encoding), + m_fail (false), m_open_state (true), m_errmsg () { } // No copying! @@ -114,7 +114,7 @@ // Return TRUE if this stream is open. - bool is_open (void) const { return open_state; } + bool is_open (void) const { return m_open_state; } virtual void do_close (void) { } @@ -122,7 +122,7 @@ { if (is_open ()) { - open_state = false; + m_open_state = false; do_close (); } } @@ -141,7 +141,7 @@ return -1; } - bool ok (void) const { return ! fail; } + bool ok (void) const { return ! m_fail; } // Return current error message for this stream. @@ -149,11 +149,11 @@ protected: - int mode (void) const { return md; } + int mode (void) const { return m_mode; } - mach_info::float_format float_format (void) const { return flt_fmt; } + mach_info::float_format float_format (void) const { return m_flt_fmt; } - std::string encoding (void) const { return mencoding; } + std::string encoding (void) const { return m_encoding; } // Set current error state and set fail to TRUE. @@ -171,26 +171,26 @@ private: // A reference count. - refcount count; + refcount m_count; // The permission bits for the file. Should be some combination of // std::ios::open_mode bits. - int md; + int m_mode; // Data format. - mach_info::float_format flt_fmt; + mach_info::float_format m_flt_fmt; // Code page - std::string mencoding; + std::string m_encoding; // TRUE if an error has occurred. - bool fail; + bool m_fail; // TRUE if this stream is open. - bool open_state; + bool m_open_state; // Should contain error message if fail is TRUE. - std::string errmsg; + std::string m_errmsg; // Functions that are defined for all input streams (input streams // are those that define is). @@ -347,17 +347,17 @@ void error (const std::string& msg) { - if (rep) - rep->error (msg); + if (m_rep) + m_rep->error (msg); } void error (const char *msg) { error (std::string (msg)); } - int file_number (void) { return rep ? rep->file_number () : -1; } + int file_number (void) { return m_rep ? m_rep->file_number () : -1; } - bool is_valid (void) const { return (rep != nullptr); } + bool is_valid (void) const { return (m_rep != nullptr); } - bool ok (void) const { return rep && rep->ok (); } + bool ok (void) const { return m_rep && m_rep->ok (); } operator bool () const { return ok (); } @@ -371,34 +371,34 @@ std::string encoding (void) { - return rep ? rep->encoding () : std::string (); + return m_rep ? m_rep->encoding () : std::string (); } std::istream * input_stream (void) { - return rep ? rep->input_stream () : nullptr; + return m_rep ? m_rep->input_stream () : nullptr; } std::ostream * output_stream (void) { - return rep ? rep->output_stream () : nullptr; + return m_rep ? m_rep->output_stream () : nullptr; } - void clearerr (void) { if (rep) rep->clearerr (); } + void clearerr (void) { if (m_rep) m_rep->clearerr (); } private: // The actual representation of this stream. - base_stream *rep; + base_stream *m_rep; bool stream_ok (bool clear = true) const { bool retval = true; - if (rep) + if (m_rep) { if (clear) - rep->clear (); + m_rep->clear (); } else retval = false; @@ -408,8 +408,8 @@ void invalid_operation (const std::string& who, const char *rw) { - if (rep) - rep->invalid_operation (who, rw); + if (m_rep) + m_rep->invalid_operation (who, rw); } octave_value @@ -462,9 +462,9 @@ typedef std::map ostrl_map; - ostrl_map list; + ostrl_map m_list; - mutable ostrl_map::const_iterator lookup_cache; + mutable ostrl_map::const_iterator m_lookup_cache; int m_stdin_file; int m_stdout_file; diff -r 196dfb42f3e9 -r b0abae0bd94b libinterp/corefcn/oct-strstrm.h --- a/libinterp/corefcn/oct-strstrm.h Tue Jun 11 12:50:34 2019 -0500 +++ b/libinterp/corefcn/oct-strstrm.h Tue Jun 11 12:53:55 2019 -0500 @@ -82,14 +82,14 @@ octave::mach_info::float_format ff = octave::mach_info::native_float_format (), const std::string& encoding = "utf-8") - : octave_base_strstream (arg_md, ff, encoding), is (data) { } + : octave_base_strstream (arg_md, ff, encoding), m_istream (data) { } octave_istrstream (const std::string& data, std::ios::openmode arg_md = std::ios::out, octave::mach_info::float_format ff = octave::mach_info::native_float_format (), const std::string& encoding = "utf-8") - : octave_base_strstream (arg_md, ff, encoding), is (data) { } + : octave_base_strstream (arg_md, ff, encoding), m_istream (data) { } // No copying! @@ -118,23 +118,26 @@ // Return nonzero if EOF has been reached on this stream. - bool eof (void) const { return is.eof (); } + bool eof (void) const { return m_istream.eof (); } - std::istream * input_stream (void) { return &is; } + std::istream * input_stream (void) { return &m_istream; } std::ostream * output_stream (void) { return nullptr; } - off_t tell (void) { return is.tellg (); } - - std::streambuf * rdbuf (void) { return is ? is.rdbuf () : nullptr; } + off_t tell (void) { return m_istream.tellg (); } - bool bad (void) const { return is.bad (); } + std::streambuf * rdbuf (void) + { + return m_istream ? m_istream.rdbuf () : nullptr; + } - void clear (void) { is.clear (); } + bool bad (void) const { return m_istream.bad (); } + + void clear (void) { m_istream.clear (); } private: - std::istringstream is; + std::istringstream m_istream; }; class @@ -146,7 +149,7 @@ octave::mach_info::float_format ff = octave::mach_info::native_float_format (), const std::string& encoding = "utf-8") - : octave_base_strstream (arg_md, ff, encoding), os () { } + : octave_base_strstream (arg_md, ff, encoding), m_ostream () { } // No copying! @@ -168,23 +171,26 @@ // Return nonzero if EOF has been reached on this stream. - bool eof (void) const { return os.eof (); } + bool eof (void) const { return m_ostream.eof (); } std::istream * input_stream (void) { return nullptr; } - std::ostream * output_stream (void) { return &os; } + std::ostream * output_stream (void) { return &m_ostream; } - std::string str (void) { return os.str (); } + std::string str (void) { return m_ostream.str (); } - std::streambuf * rdbuf (void) { return os ? os.rdbuf () : nullptr; } + std::streambuf * rdbuf (void) + { + return m_ostream ? m_ostream.rdbuf () : nullptr; + } - bool bad (void) const { return os.bad (); } + bool bad (void) const { return m_ostream.bad (); } - void clear (void) { os.clear (); } + void clear (void) { m_ostream.clear (); } private: - std::ostringstream os; + std::ostringstream m_ostream; }; #endif diff -r 196dfb42f3e9 -r b0abae0bd94b libinterp/corefcn/procstream.cc --- a/libinterp/corefcn/procstream.cc Tue Jun 11 12:50:34 2019 -0500 +++ b/libinterp/corefcn/procstream.cc Tue Jun 11 12:53:55 2019 -0500 @@ -30,13 +30,13 @@ procstreambase::procstreambase (const std::string& command, int mode) { - if (! pb.open (command.c_str (), mode)) + if (! m_pb.open (command.c_str (), mode)) std::ios::setstate (std::ios::badbit); } procstreambase::procstreambase (const char *command, int mode) { - if (! pb.open (command, mode)) + if (! m_pb.open (command, mode)) std::ios::setstate (std::ios::badbit); } @@ -45,7 +45,7 @@ { clear (); - if (! pb.open (command, mode)) + if (! m_pb.open (command, mode)) std::ios::setstate (std::ios::badbit); } @@ -56,10 +56,10 @@ if (is_open ()) { - if (! pb.close ()) + if (! m_pb.close ()) std::ios::setstate (std::ios::failbit); - status = pb.wait_status (); + status = m_pb.wait_status (); } return status; diff -r 196dfb42f3e9 -r b0abae0bd94b libinterp/corefcn/procstream.h --- a/libinterp/corefcn/procstream.h Tue Jun 11 12:50:34 2019 -0500 +++ b/libinterp/corefcn/procstream.h Tue Jun 11 12:53:55 2019 -0500 @@ -38,7 +38,7 @@ { public: - procstreambase (void) : pb () { } + procstreambase (void) : m_pb () { } procstreambase (const std::string& name, int mode); @@ -47,21 +47,23 @@ ~procstreambase (void) { close (); } void open (const std::string& name, int mode) - { open (name.c_str (), mode); } + { + open (name.c_str (), mode); + } void open (const char *name, int mode); - int is_open (void) const { return pb.is_open (); } + int is_open (void) const { return m_pb.is_open (); } int close (void); - pid_t pid (void) const { return pb.pid (); } + pid_t pid (void) const { return m_pb.pid (); } - int file_number (void) const { return pb.file_number (); } + int file_number (void) const { return m_pb.file_number (); } private: - octave_procbuf pb; + octave_procbuf m_pb; procstreambase (const procstreambase&); @@ -78,18 +80,24 @@ iprocstream (void) : std::istream (nullptr), procstreambase () { } iprocstream (const std::string& name, int mode = std::ios::in) - : std::istream (nullptr), procstreambase (name, mode) { } + : std::istream (nullptr), procstreambase (name, mode) + { } iprocstream (const char *name, int mode = std::ios::in) - : std::istream (nullptr), procstreambase (name, mode) { } + : std::istream (nullptr), procstreambase (name, mode) + { } ~iprocstream (void) = default; void open (const std::string& name, int mode = std::ios::in) - { procstreambase::open (name, mode); } + { + procstreambase::open (name, mode); + } void open (const char *name, int mode = std::ios::in) - { procstreambase::open (name, mode); } + { + procstreambase::open (name, mode); + } private: @@ -101,7 +109,6 @@ class OCTINTERP_API oprocstream : public std::ostream, public procstreambase -// oprocstream : public procstreambase, public std::ostream { public: @@ -116,10 +123,14 @@ ~oprocstream (void) = default; void open (const std::string& name, int mode = std::ios::out) - { procstreambase::open (name, mode); } + { + procstreambase::open (name, mode); + } void open (const char *name, int mode = std::ios::out) - { procstreambase::open (name, mode); } + { + procstreambase::open (name, mode); + } private: @@ -131,25 +142,30 @@ class OCTINTERP_API procstream : public std::iostream, public procstreambase -// procstream : public procstreambase, public std::iostream { public: procstream (void) : std::iostream (nullptr), procstreambase () { } procstream (const std::string& name, int mode) - : std::iostream (nullptr), procstreambase (name, mode) { } + : std::iostream (nullptr), procstreambase (name, mode) + { } procstream (const char *name, int mode) - : std::iostream (nullptr), procstreambase (name, mode) { } + : std::iostream (nullptr), procstreambase (name, mode) + { } ~procstream (void) = default; void open (const std::string& name, int mode) - { procstreambase::open (name, mode); } + { + procstreambase::open (name, mode); + } void open (const char *name, int mode) - { procstreambase::open (name, mode); } + { + procstreambase::open (name, mode); + } private: