# HG changeset patch # User jwe # Date 821270278 0 # Node ID c43d042f20be424d04efe9a21f827472bee22815 # Parent a744f4d0ba5927b80bfacdc64e69471a5b3f0000 [project @ 1996-01-10 10:37:09 by jwe] diff --git a/liboctave/chMatrix.h b/liboctave/chMatrix.h --- a/liboctave/chMatrix.h +++ b/liboctave/chMatrix.h @@ -50,6 +50,7 @@ charMatrix (const MArray2& a) : MArray2 (a) { } charMatrix (const charMatrix& a) : MArray2 (a) { } charMatrix (const char *s); + charMatrix (const string& s); charMatrix& operator = (const charMatrix& a) { diff --git a/src/pt-const.cc b/src/pt-const.cc --- a/src/pt-const.cc +++ b/src/pt-const.cc @@ -665,6 +665,13 @@ orig_text = 0; } +TC_REP::tree_constant_rep (const string& s) +{ + char_matrix = new charMatrix (s); + type_tag = char_matrix_constant_str; + orig_text = 0; +} + TC_REP::tree_constant_rep (const charMatrix& chm, int is_str) { char_matrix = new charMatrix (chm); diff --git a/src/pt-const.h b/src/pt-const.h --- a/src/pt-const.h +++ b/src/pt-const.h @@ -99,6 +99,7 @@ tree_constant_rep (const ComplexColumnVector& v, int pcv); tree_constant_rep (const char *s); + tree_constant_rep (const string& s); tree_constant_rep (const charMatrix& chm, int is_string); tree_constant_rep (double base, double limit, double inc); @@ -343,6 +344,7 @@ // ComplexColumnVector // char matrix charMatrix // string char* (null terminated) + // string // charMatrix // range double, double, double // Range @@ -386,6 +388,9 @@ tree_constant (const char *s, int l = -1, int c = -1) : tree_fvc (l, c) { rep = new tree_constant_rep (s); rep->count = 1; } + tree_constant (const string& s, int l = -1, int c = -1) : tree_fvc (l, c) + { rep = new tree_constant_rep (s); rep->count = 1; } + tree_constant (const charMatrix& chm, int is_string = 0) : tree_fvc () { rep = new tree_constant_rep (chm, is_string); rep->count = 1; }