diff src/ov-fcn-inline.cc @ 5765:7ba9ad1fec11

[project @ 2006-04-17 05:05:15 by jwe]
author jwe
date Mon, 17 Apr 2006 05:05:17 +0000
parents 8d7162924bd3
children ace8d8d26933
line wrap: on
line diff
--- a/src/ov-fcn-inline.cc
+++ b/src/ov-fcn-inline.cc
@@ -29,6 +29,7 @@
 
 #include <istream>
 #include <iostream>
+#include <sstream>
 #include <vector>
 
 #include "defun.h"
@@ -59,7 +60,7 @@
 {
   // Form a string representing the function.
 
-  OSSTREAM buf;
+  std::ostringstream buf;
 
   buf << "@(";
 
@@ -71,13 +72,10 @@
       buf << ifargs(i);
     }
 
-  buf << ") " << iftext << OSSTREAM_ENDS;
+  buf << ") " << iftext;
 
   int parse_status;
-  octave_value anon_fcn_handle = eval_string (OSSTREAM_STR (buf), true,
-					      parse_status);
-
-  OSSTREAM_FREEZE (buf);
+  octave_value anon_fcn_handle = eval_string (buf.str (), true, parse_status);
 
   if (parse_status == 0)
     {
@@ -120,7 +118,7 @@
 	nm = "";
 
       char c;
-      OSSTREAM buf;
+      std::ostringstream buf;
 
       // Skip preceeding newline(s)
       while (is.get (c) && c == '\n');
@@ -140,9 +138,7 @@
 	    }
 	}
 
-      buf << OSSTREAM_ENDS;
-      iftext = OSSTREAM_STR (buf);
-      OSSTREAM_FREEZE (buf);
+      iftext = buf.str ();
 
       octave_fcn_inline tmp (iftext, ifargs, nm);
       fcn = tmp.fcn;
@@ -535,7 +531,7 @@
 void
 octave_fcn_inline::print_raw (std::ostream& os, bool pr_as_read_syntax) const
 {
-  OSSTREAM buf;
+  std::ostringstream buf;
 
   if (nm.empty ())
     buf << "f(";
@@ -550,11 +546,10 @@
       buf << ifargs(i);
     }
 
-  buf << ") = " << iftext << OSSTREAM_ENDS;
+  buf << ") = " << iftext;
 
-  octave_print_internal (os, OSSTREAM_STR (buf), pr_as_read_syntax,
+  octave_print_internal (os, buf.str (), pr_as_read_syntax,
 			 current_print_indent_level ());
-  OSSTREAM_FREEZE (buf);
 }
 
 octave_value
@@ -682,10 +677,9 @@
 
 		      for (int i = 1; i < n+1; i++)
 			{
-			  OSSTREAM buf;
-			  buf << "P" << i << OSSTREAM_ENDS;
-			  fargs(i) = OSSTREAM_STR (buf);
-			  OSSTREAM_FREEZE (buf);
+			  std::ostringstream buf;
+			  buf << "P" << i;
+			  fargs(i) = buf.str ();
 			}
 		    }
 		  else