From 554fd8c5195424bdbcabf5de30fdc183aba391bd Mon Sep 17 00:00:00 2001 From: upstream source tree Date: Sun, 15 Mar 2015 20:14:05 -0400 Subject: obtained gcc-4.6.4.tar.bz2 from upstream website; verified gcc-4.6.4.tar.bz2.sig; imported gcc-4.6.4 source tree from verified upstream tarball. downloading a git-generated archive based on the 'upstream' tag should provide you with a source tree that is binary identical to the one extracted from the above tarball. if you have obtained the source via the command 'git clone', however, do note that line-endings of files in your working directory might differ from line-endings of the respective files in the upstream repository. --- libstdc++-v3/doc/html/manual/stringstreams.html | 37 +++++++++++++++++++++++++ 1 file changed, 37 insertions(+) create mode 100644 libstdc++-v3/doc/html/manual/stringstreams.html (limited to 'libstdc++-v3/doc/html/manual/stringstreams.html') diff --git a/libstdc++-v3/doc/html/manual/stringstreams.html b/libstdc++-v3/doc/html/manual/stringstreams.html new file mode 100644 index 000000000..1107d61b1 --- /dev/null +++ b/libstdc++-v3/doc/html/manual/stringstreams.html @@ -0,0 +1,37 @@ + + +Memory Based Streams

+

Stringstreams (defined in the header <sstream>) + are in this author's opinion one of the coolest things since + sliced time. An example of their use is in the Received Wisdom + section for Sect1 21 (Strings), + describing how to + format strings. +

The quick definition is: they are siblings of ifstream and ofstream, + and they do for std::string what their siblings do for + files. All that work you put into writing << and + >> functions for your classes now pays off + again! Need to format a string before passing the string + to a function? Send your stuff via << to an + ostringstream. You've read a string as input and need to parse it? + Initialize an istringstream with that string, and then pull pieces + out of it with >>. Have a stringstream and need to + get a copy of the string inside? Just call the str() + member function. +

This only works if you've written your + <</>> functions correctly, though, + and correctly means that they take istreams and ostreams as + parameters, not ifstreams and ofstreams. If they + take the latter, then your I/O operators will work fine with + file streams, but with nothing else -- including stringstreams. +

If you are a user of the strstream classes, you need to update + your code. You don't have to explicitly append ends to + terminate the C-style character array, you don't have to mess with + "freezing" functions, and you don't have to manage the + memory yourself. The strstreams have been officially deprecated, + which means that 1) future revisions of the C++ Standard won't + support them, and 2) if you use them, people will laugh at you. +

-- cgit v1.2.3