Mercurial > octave-nkf
diff libinterp/corefcn/symtab.cc @ 17870:1d2e709bbbda
rework short_disp methods
* ov.h (octave_value::short_disp): Pass std::ostream as
argument instead of returning std::string. Change all uses.
* ov-base.h (octave_base_value::short_disp): Likewise. Change all
derived classes.
* ov-base-scalar.cc (octave_base_scalar<ST>::short_disp): Strip
leading whitepace from number.
* ov-base-mat.cc (octave_base_matrix<MT>::short_disp): Strip
leading whitepace from numbers.
author | John W. Eaton <jwe@octave.org> |
---|---|
date | Thu, 07 Nov 2013 00:52:48 -0500 |
parents | 86e8dbccf7c7 |
children | 6762a6d23010 |
line wrap: on
line diff
--- a/libinterp/corefcn/symtab.cc Sun Oct 27 13:03:33 2013 +0100 +++ b/libinterp/corefcn/symtab.cc Thu Nov 07 00:52:48 2013 -0500 @@ -25,6 +25,8 @@ #include <config.h> #endif +#include <sstream> + #include "file-ops.h" #include "file-stat.h" #include "oct-env.h" @@ -1418,8 +1420,12 @@ else if (sr.is_inherited ()) storage = 'i'; + std::ostringstream buf; + val.short_disp (buf); + std::string short_disp_str = buf.str (); + workspace_element elt (storage, nm, val.class_name (), - val.short_disp (), dv.str (), + short_disp_str, dv.str (), val.is_complex_type ()); retval.push_back (elt);