From: Ares Lagae (ares.lagae_at_[hidden])
Date: 2007-06-06 09:10:53
I have updated the binary_iostreams library.
- some small bugfixes
- added classes binary_istringstream, binary_ostringstream and
- removed << and >> operators for string types
* classes binary_istringstream, binary_ostringstream and binary_stringstream
The classes binary_istringstream, binary_ostringstream and
binary_stringstream allow to read/write to a string that serves as buffer
for the binary data. (althought a streambuf that writes to
std::vector<unsigned char> would be more suited).
bostringstream << p << p << p;
const std::string& buffer = bostringstream.str();
// write buffer a binary_ostream
* << and >> operators for string types
The stream classes now only support fundamental data types. I am not sure
how and wether to handle strings. For example, a regular char* string can
be output as a null terminated array of char's, or as a size and a non
null-terminated array of char's. Although I prefer the first solution (more
portable, no problems with the size of the size type in the second
solution), I am not sure if the library should make such a decision.
I am also planning on adding a compressing_streambuf class, that can be used
in both the IOStreams and the binary_iostreams library.
I agree with a lot of the comments on design of I/O libraries in the
previous posts. However, I do not have the time to design and implement an
improved I/O system for C++, and until such a system exists, I am convinced
that binary_iostreams should be as close as possible mimic the existing std
* Updated URL's:
Direct link to a motivating example:
-- Ares Lagae Computer Graphics Research Group, Katholieke Universiteit Leuven http://www.cs.kuleuven.be/~ares/
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk