comparison src/ov-struct.cc @ 5598:86cd3d260b42

[project @ 2006-01-14 01:09:42 by jwe]
author jwe
date Sat, 14 Jan 2006 01:09:43 +0000
parents 61d6cebd243b
children 2618a0750ae6
comparison
equal deleted inserted replaced
5597:e0e48ea2a93c 5598:86cd3d260b42
411 411
412 unwind_protect_int (Vstruct_levels_to_print); 412 unwind_protect_int (Vstruct_levels_to_print);
413 413
414 if (Vstruct_levels_to_print >= 0) 414 if (Vstruct_levels_to_print >= 0)
415 { 415 {
416 bool print_keys_only = (Vstruct_levels_to_print == 0 || 416 bool print_keys_only = (Vstruct_levels_to_print == 0
417 map.numel() == 0); 417 || map.numel () == 0);
418 418
419 Vstruct_levels_to_print--; 419 Vstruct_levels_to_print--;
420 420
421 indent (os); 421 indent (os);
422 os << "{"; 422 os << "{";
423 newline (os); 423 newline (os);
424 424
425 increment_indent_level (); 425 increment_indent_level ();
426 426
427 octave_idx_type n = map_keys().length(); 427 octave_idx_type n = map.numel ();
428 428
429 if (n > 1 && print_keys_only) 429 if (n == 0 || (n > 1 && print_keys_only))
430 { 430 {
431 indent (os); 431 indent (os);
432 dim_vector dv = dims (); 432 dim_vector dv = dims ();
433 os << dv.str () << " struct array containing the fields:"; 433 os << dv.str () << " struct array containing the fields:";
434 newline (os); 434 newline (os);
457 } 457 }
458 else 458 else
459 tmp.print_with_name (os, key); 459 tmp.print_with_name (os, key);
460 } 460 }
461 461
462 if (n > 1 && print_keys_only) 462 if (n == 0 || (n > 1 && print_keys_only))
463 decrement_indent_level (); 463 decrement_indent_level ();
464 464
465 decrement_indent_level (); 465 decrement_indent_level ();
466 466
467 indent (os); 467 indent (os);