Mercurial > hg > octave-nkf
diff src/oct-stream.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/oct-stream.cc +++ b/src/oct-stream.cc @@ -30,6 +30,7 @@ #include <iomanip> #include <fstream> +#include <sstream> #include <string> #include <Array.h> @@ -41,7 +42,6 @@ #include "byte-swap.h" #include "lo-ieee.h" #include "lo-mappers.h" -#include "lo-sstream.h" #include "lo-utils.h" #include "str-vec.h" #include "quit.h" @@ -176,7 +176,7 @@ have_more = true; if (! buf) - buf = new OSSTREAM (); + buf = new std::ostringstream (); if (s[i] == '%') { @@ -251,11 +251,7 @@ { if (buf) { - *buf << OSSTREAM_ENDS; - - std::string text = OSSTREAM_STR (*buf); - - OSSTREAM_FREEZE (*buf); + std::string text = buf->str (); if (! text.empty ()) { @@ -612,7 +608,7 @@ if (! buf) { - buf = new OSSTREAM (); + buf = new std::ostringstream (); empty_buf = true; } @@ -681,11 +677,7 @@ { if (buf) { - *buf << OSSTREAM_ENDS; - - std::string text = OSSTREAM_STR (*buf); - - OSSTREAM_FREEZE (*buf); + std::string text = buf->str (); if (! text.empty ()) { @@ -977,7 +969,7 @@ { std::istream& is = *isp; - OSSTREAM buf; + std::ostringstream buf; int c = 0; int char_count = 0; @@ -1004,11 +996,7 @@ } if (is.good () || (is.eof () && char_count > 0)) - { - buf << OSSTREAM_ENDS; - retval = OSSTREAM_STR (buf); - OSSTREAM_FREEZE (buf); - } + retval = buf.str (); else { err = true; @@ -1538,7 +1526,7 @@ } \ else \ { \ - OSSTREAM buf; \ + std::ostringstream buf; \ \ std::string char_class = elt->char_class; \ \ @@ -1560,9 +1548,7 @@ if (c != EOF) \ is.putback (c); \ \ - buf << OSSTREAM_ENDS; \ - tmp = OSSTREAM_STR (buf); \ - OSSTREAM_FREEZE (buf); \ + tmp = buf.str (); \ \ if (tmp.empty ()) \ is.setstate (std::ios::failbit); \ @@ -4091,7 +4077,7 @@ { std::string retval; - OSSTREAM buf; + std::ostringstream buf; buf << "\n" << " number mode arch name\n" @@ -4114,11 +4100,9 @@ << os.name () << "\n"; } - buf << "\n" << OSSTREAM_ENDS; - - retval = OSSTREAM_STR (buf); - - OSSTREAM_FREEZE (buf); + buf << "\n"; + + retval = buf.str (); return retval; }