comparison src/oct-stream.cc @ 7352:fab9bc33b949

[project @ 2008-01-07 18:54:45 by jwe]
author jwe
date Mon, 07 Jan 2008 18:54:45 +0000
parents bf7235434a2a
children b9df9abdffbb
comparison
equal deleted inserted replaced
7351:8470a6b0b769 7352:fab9bc33b949
45 #include "lo-utils.h" 45 #include "lo-utils.h"
46 #include "str-vec.h" 46 #include "str-vec.h"
47 #include "quit.h" 47 #include "quit.h"
48 48
49 #include "error.h" 49 #include "error.h"
50 #include "gripes.h"
50 #include "input.h" 51 #include "input.h"
51 #include "oct-stdstrm.h" 52 #include "oct-stdstrm.h"
52 #include "oct-stream.h" 53 #include "oct-stream.h"
53 #include "oct-obj.h" 54 #include "oct-obj.h"
54 #include "utils.h" 55 #include "utils.h"
2274 { 2275 {
2275 public: 2276 public:
2276 2277
2277 enum state { ok, conversion_error }; 2278 enum state { ok, conversion_error };
2278 2279
2279 printf_value_cache (const octave_value_list& args) 2280 printf_value_cache (const octave_value_list& args, const std::string& who)
2280 : values (args), val_idx (0), elt_idx (0), 2281 : values (args), val_idx (0), elt_idx (0),
2281 n_vals (values.length ()), n_elts (0), data (0), 2282 n_vals (values.length ()), n_elts (0), data (0),
2282 curr_state (ok) { } 2283 curr_state (ok)
2284 {
2285 for (octave_idx_type i = 0; i < values.length (); i++)
2286 {
2287 octave_value val = values(i);
2288
2289 if (val.is_map () || val.is_cell () || val.is_object ()
2290 || val.is_list ())
2291 {
2292 gripe_wrong_type_arg (who, val);
2293 break;
2294 }
2295 }
2296 }
2283 2297
2284 ~printf_value_cache (void) { } 2298 ~printf_value_cache (void) { }
2285 2299
2286 // Get the current value as a double and advance the internal pointer. 2300 // Get the current value as a double and advance the internal pointer.
2287 double double_value (void); 2301 double double_value (void);
2525 { 2539 {
2526 std::ostream& os = *osp; 2540 std::ostream& os = *osp;
2527 2541
2528 const printf_format_elt *elt = fmt_list.first (); 2542 const printf_format_elt *elt = fmt_list.first ();
2529 2543
2530 printf_value_cache val_cache (args); 2544 printf_value_cache val_cache (args, who);
2545
2546 if (error_state)
2547 return retval;
2531 2548
2532 for (;;) 2549 for (;;)
2533 { 2550 {
2534 OCTAVE_QUIT; 2551 OCTAVE_QUIT;
2535 2552