changeset 1731:c43d042f20be

[project @ 1996-01-10 10:37:09 by jwe]
author jwe
date Wed, 10 Jan 1996 10:37:58 +0000
parents a744f4d0ba59
children a00118041518
files liboctave/chMatrix.h src/pt-const.cc src/pt-const.h
diffstat 3 files changed, 13 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/liboctave/chMatrix.h	Tue Jan 09 12:18:45 1996 +0000
+++ b/liboctave/chMatrix.h	Wed Jan 10 10:37:58 1996 +0000
@@ -50,6 +50,7 @@
   charMatrix (const MArray2<char>& a) : MArray2<char> (a) { }
   charMatrix (const charMatrix& a) : MArray2<char> (a) { }
   charMatrix (const char *s);
+  charMatrix (const string& s);
 
   charMatrix& operator = (const charMatrix& a)
     {
--- a/src/pt-const.cc	Tue Jan 09 12:18:45 1996 +0000
+++ b/src/pt-const.cc	Wed Jan 10 10:37:58 1996 +0000
@@ -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);
--- a/src/pt-const.h	Tue Jan 09 12:18:45 1996 +0000
+++ b/src/pt-const.h	Wed Jan 10 10:37:58 1996 +0000
@@ -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; }