comparison libinterp/corefcn/load-save.cc @ 18949:d5db1019ad4a

load-save.cc: Return string rather printing to octave_stdout
author Andreas Weber <andy.weber.aw@gmail.com>
date Mon, 21 Jul 2014 18:27:10 +0200
parents 2b82d2f29a7b
children
comparison
equal deleted inserted replaced
18948:64173c377a6b 18949:d5db1019ad4a
1501 "-*- texinfo -*-\n\ 1501 "-*- texinfo -*-\n\
1502 @deftypefn {Command} {} save file\n\ 1502 @deftypefn {Command} {} save file\n\
1503 @deftypefnx {Command} {} save options file\n\ 1503 @deftypefnx {Command} {} save options file\n\
1504 @deftypefnx {Command} {} save options file @var{v1} @var{v2} @dots{}\n\ 1504 @deftypefnx {Command} {} save options file @var{v1} @var{v2} @dots{}\n\
1505 @deftypefnx {Command} {} save options file -struct @var{STRUCT} @var{f1} @var{f2} @dots{}\n\ 1505 @deftypefnx {Command} {} save options file -struct @var{STRUCT} @var{f1} @var{f2} @dots{}\n\
1506 @deftypefnx {Command} {} {@var{s} =} save @samp{-} @var{v1} @var{v2} @dots{}\n\
1506 Save the named variables @var{v1}, @var{v2}, @dots{}, in the file\n\ 1507 Save the named variables @var{v1}, @var{v2}, @dots{}, in the file\n\
1507 @var{file}. The special filename @samp{-} may be used to write\n\ 1508 @var{file}. The special filename @samp{-} may be used to return the\n\
1508 output to the terminal. If no variable names are listed, Octave saves\n\ 1509 content of the variables as a string. If no variable names are listed, Octave saves\n\
1509 all the variables in the current scope. Otherwise, full variable names or\n\ 1510 all the variables in the current scope. Otherwise, full variable names or\n\
1510 pattern syntax can be used to specify the variables to save.\n\ 1511 pattern syntax can be used to specify the variables to save.\n\
1511 If the @option{-struct} modifier is used, fields @var{f1} @var{f2} @dots{}\n\ 1512 If the @option{-struct} modifier is used, fields @var{f1} @var{f2} @dots{}\n\
1512 of the scalar structure @var{STRUCT} are saved as if they were variables\n\ 1513 of the scalar structure @var{STRUCT} are saved as if they were variables\n\
1513 with corresponding names.\n\ 1514 with corresponding names.\n\
1678 // with the "else" above! 1679 // with the "else" above!
1679 { 1680 {
1680 if (append) 1681 if (append)
1681 warning ("save: ignoring -append option for output to stdout"); 1682 warning ("save: ignoring -append option for output to stdout");
1682 1683
1683 // FIXME: should things intended for the screen 1684 std::ostringstream output_buf;
1684 // end up in an octave_value (string)? 1685 save_vars (argv, i, argc, output_buf, format,
1685
1686 save_vars (argv, i, argc, octave_stdout, format,
1687 save_as_floats, true); 1686 save_as_floats, true);
1687 retval = octave_value (output_buf.str());
1688 } 1688 }
1689 } 1689 }
1690 1690
1691 // Guard against things like 'save a*', which are probably mistakes... 1691 // Guard against things like 'save a*', which are probably mistakes...
1692 1692