Mercurial > octave
comparison 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 |
comparison
equal
deleted
inserted
replaced
17869:e8330a9e8c78 | 17870:1d2e709bbbda |
---|---|
22 */ | 22 */ |
23 | 23 |
24 #ifdef HAVE_CONFIG_H | 24 #ifdef HAVE_CONFIG_H |
25 #include <config.h> | 25 #include <config.h> |
26 #endif | 26 #endif |
27 | |
28 #include <sstream> | |
27 | 29 |
28 #include "file-ops.h" | 30 #include "file-ops.h" |
29 #include "file-stat.h" | 31 #include "file-stat.h" |
30 #include "oct-env.h" | 32 #include "oct-env.h" |
31 #include "oct-time.h" | 33 #include "oct-time.h" |
1416 else if (sr.is_hidden ()) | 1418 else if (sr.is_hidden ()) |
1417 storage = 'h'; | 1419 storage = 'h'; |
1418 else if (sr.is_inherited ()) | 1420 else if (sr.is_inherited ()) |
1419 storage = 'i'; | 1421 storage = 'i'; |
1420 | 1422 |
1423 std::ostringstream buf; | |
1424 val.short_disp (buf); | |
1425 std::string short_disp_str = buf.str (); | |
1426 | |
1421 workspace_element elt (storage, nm, val.class_name (), | 1427 workspace_element elt (storage, nm, val.class_name (), |
1422 val.short_disp (), dv.str (), | 1428 short_disp_str, dv.str (), |
1423 val.is_complex_type ()); | 1429 val.is_complex_type ()); |
1424 | 1430 |
1425 retval.push_back (elt); | 1431 retval.push_back (elt); |
1426 } | 1432 } |
1427 } | 1433 } |