comparison src/ov.cc @ 5279:bd32f770c09a

[project @ 2005-04-12 21:55:31 by jwe]
author jwe
date Tue, 12 Apr 2005 21:55:31 +0000
parents 23b37da9fd5b
children 4c8a2e4e0717
comparison
equal deleted inserted replaced
5278:fe23ec6763b7 5279:bd32f770c09a
548 { 548 {
549 rep->count = 1; 549 rep->count = 1;
550 maybe_mutate (); 550 maybe_mutate ();
551 } 551 }
552 552
553 octave_value::octave_value (char c) 553 octave_value::octave_value (char c, char type)
554 : rep (new octave_char_matrix_str (c)) 554 : rep (type == '"'
555 { 555 ? new octave_char_matrix_dq_str (c)
556 rep->count = 1; 556 : new octave_char_matrix_sq_str (c))
557 maybe_mutate (); 557 {
558 } 558 rep->count = 1;
559 559 maybe_mutate ();
560 octave_value::octave_value (const char *s) 560 }
561 : rep (new octave_char_matrix_str (s)) 561
562 { 562 octave_value::octave_value (const char *s, char type)
563 rep->count = 1; 563 : rep (type == '"'
564 maybe_mutate (); 564 ? new octave_char_matrix_dq_str (s)
565 } 565 : new octave_char_matrix_sq_str (s))
566 566 {
567 octave_value::octave_value (const std::string& s) 567 rep->count = 1;
568 : rep (new octave_char_matrix_str (s)) 568 maybe_mutate ();
569 { 569 }
570 rep->count = 1; 570
571 maybe_mutate (); 571 octave_value::octave_value (const std::string& s, char type)
572 } 572 : rep (type == '"'
573 573 ? new octave_char_matrix_dq_str (s)
574 octave_value::octave_value (const string_vector& s) 574 : new octave_char_matrix_sq_str (s))
575 : rep (new octave_char_matrix_str (s)) 575 {
576 { 576 rep->count = 1;
577 rep->count = 1; 577 maybe_mutate ();
578 maybe_mutate (); 578 }
579 } 579
580 580 octave_value::octave_value (const string_vector& s, char type)
581 octave_value::octave_value (const charMatrix& chm, bool is_str) 581 : rep (type == '"'
582 ? new octave_char_matrix_dq_str (s)
583 : new octave_char_matrix_sq_str (s))
584 {
585 rep->count = 1;
586 maybe_mutate ();
587 }
588
589 octave_value::octave_value (const charMatrix& chm, bool is_str, char type)
582 : rep (is_str 590 : rep (is_str
583 ? new octave_char_matrix_str (chm) 591 ? (type == '"'
592 ? new octave_char_matrix_dq_str (chm)
593 : new octave_char_matrix_sq_str (chm))
584 : new octave_char_matrix (chm)) 594 : new octave_char_matrix (chm))
585 { 595 {
586 rep->count = 1; 596 rep->count = 1;
587 maybe_mutate (); 597 maybe_mutate ();
588 } 598 }
589 599
590 octave_value::octave_value (const charNDArray& chm, bool is_str) 600 octave_value::octave_value (const charNDArray& chm, bool is_str, char type)
591 : rep (is_str 601 : rep (is_str
592 ? new octave_char_matrix_str (chm) 602 ? (type == '"'
603 ? new octave_char_matrix_dq_str (chm)
604 : new octave_char_matrix_sq_str (chm))
593 : new octave_char_matrix (chm)) 605 : new octave_char_matrix (chm))
594 { 606 {
595 rep->count = 1; 607 rep->count = 1;
596 maybe_mutate (); 608 maybe_mutate ();
597 } 609 }
598 610
599 octave_value::octave_value (const ArrayN<char>& chm, bool is_str) 611 octave_value::octave_value (const ArrayN<char>& chm, bool is_str, char type)
600 : rep (is_str 612 : rep (is_str
601 ? new octave_char_matrix_str (chm) 613 ? (type == '"'
614 ? new octave_char_matrix_dq_str (chm)
615 : new octave_char_matrix_sq_str (chm))
602 : new octave_char_matrix (chm)) 616 : new octave_char_matrix (chm))
603 { 617 {
604 rep->count = 1; 618 rep->count = 1;
605 maybe_mutate (); 619 maybe_mutate ();
606 } 620 }
1456 1470
1457 return retval; 1471 return retval;
1458 } 1472 }
1459 1473
1460 octave_value 1474 octave_value
1461 octave_value::convert_to_str (bool pad, bool force) const 1475 octave_value::convert_to_str (bool pad, bool force, char type) const
1462 { 1476 {
1463 octave_value retval = convert_to_str_internal (pad, force); 1477 octave_value retval = convert_to_str_internal (pad, force, type);
1464 1478
1465 if (! force && is_numeric_type () && Vwarn_num_to_str) 1479 if (! force && is_numeric_type () && Vwarn_num_to_str)
1466 gripe_implicit_conversion (type_name (), retval.type_name ()); 1480 gripe_implicit_conversion (type_name (), retval.type_name ());
1467 1481
1468 return retval; 1482 return retval;
2178 octave_range::register_type (); 2192 octave_range::register_type ();
2179 octave_bool::register_type (); 2193 octave_bool::register_type ();
2180 octave_bool_matrix::register_type (); 2194 octave_bool_matrix::register_type ();
2181 octave_char_matrix::register_type (); 2195 octave_char_matrix::register_type ();
2182 octave_char_matrix_str::register_type (); 2196 octave_char_matrix_str::register_type ();
2197 octave_char_matrix_sq_str::register_type ();
2183 octave_int8_scalar::register_type (); 2198 octave_int8_scalar::register_type ();
2184 octave_int16_scalar::register_type (); 2199 octave_int16_scalar::register_type ();
2185 octave_int32_scalar::register_type (); 2200 octave_int32_scalar::register_type ();
2186 octave_int64_scalar::register_type (); 2201 octave_int64_scalar::register_type ();
2187 octave_uint8_scalar::register_type (); 2202 octave_uint8_scalar::register_type ();