Mercurial > hg > octave-lyh
comparison src/load-save.cc @ 5765:7ba9ad1fec11
[project @ 2006-04-17 05:05:15 by jwe]
author | jwe |
---|---|
date | Mon, 17 Apr 2006 05:05:17 +0000 |
parents | 8d7162924bd3 |
children | ace8d8d26933 |
comparison
equal
deleted
inserted
replaced
5764:80409c2defcc | 5765:7ba9ad1fec11 |
---|---|
34 #include <cctype> | 34 #include <cctype> |
35 | 35 |
36 #include <fstream> | 36 #include <fstream> |
37 #include <iomanip> | 37 #include <iomanip> |
38 #include <iostream> | 38 #include <iostream> |
39 #include <sstream> | |
39 #include <string> | 40 #include <string> |
40 | 41 |
41 #ifdef HAVE_HDF5 | 42 #ifdef HAVE_HDF5 |
42 #include <hdf5.h> | 43 #include <hdf5.h> |
43 #endif | 44 #endif |
45 #include "byte-swap.h" | 46 #include "byte-swap.h" |
46 #include "data-conv.h" | 47 #include "data-conv.h" |
47 #include "file-ops.h" | 48 #include "file-ops.h" |
48 #include "glob-match.h" | 49 #include "glob-match.h" |
49 #include "lo-mappers.h" | 50 #include "lo-mappers.h" |
50 #include "lo-sstream.h" | |
51 #include "mach-info.h" | 51 #include "mach-info.h" |
52 #include "oct-env.h" | 52 #include "oct-env.h" |
53 #include "oct-time.h" | 53 #include "oct-time.h" |
54 #include "quit.h" | 54 #include "quit.h" |
55 #include "str-vec.h" | 55 #include "str-vec.h" |
442 { | 442 { |
443 octave_value retval; | 443 octave_value retval; |
444 | 444 |
445 Octave_map retstruct; | 445 Octave_map retstruct; |
446 | 446 |
447 OSSTREAM output_buf; | 447 std::ostringstream output_buf; |
448 | 448 |
449 octave_idx_type count = 0; | 449 octave_idx_type count = 0; |
450 | 450 |
451 for (;;) | 451 for (;;) |
452 { | 452 { |
558 } | 558 } |
559 } | 559 } |
560 | 560 |
561 if (list_only && count) | 561 if (list_only && count) |
562 { | 562 { |
563 output_buf << OSSTREAM_ENDS; | 563 std::string msg = output_buf.str (); |
564 std::string msg = OSSTREAM_STR (output_buf); | |
565 OSSTREAM_FREEZE (output_buf); | |
566 | 564 |
567 if (nargout > 0) | 565 if (nargout > 0) |
568 retval = msg; | 566 retval = msg; |
569 else | 567 else |
570 octave_stdout << msg; | 568 octave_stdout << msg; |
1181 static int | 1179 static int |
1182 parse_save_options (const std::string &arg, load_save_format &format, | 1180 parse_save_options (const std::string &arg, load_save_format &format, |
1183 bool &append, bool &save_as_floats, | 1181 bool &append, bool &save_as_floats, |
1184 bool &save_builtins, bool &use_zlib, int start_arg) | 1182 bool &save_builtins, bool &use_zlib, int start_arg) |
1185 { | 1183 { |
1186 ISSTREAM is (arg); | 1184 std::istringstream is (arg); |
1187 std::string str; | 1185 std::string str; |
1188 int argc = 0; | 1186 int argc = 0; |
1189 string_vector argv; | 1187 string_vector argv; |
1190 | 1188 |
1191 while (!is.eof ()) | 1189 while (! is.eof ()) |
1192 { | 1190 { |
1193 is >> str; | 1191 is >> str; |
1194 argv.append (str); | 1192 argv.append (str); |
1195 argc++; | 1193 argc++; |
1196 } | 1194 } |