Boost logo

Boost :

Subject: Re: [boost] Interest in simple unformatted binary stream I/O?
From: Jeff Flinn (Jeffrey.Flinn_at_[hidden])
Date: 2011-05-27 08:32:10


Beman Dawes wrote:
> There have been many requests on Boost and various C++ newsgroups for
> unformatted binary I/O. For example, in 2003 Neal Becker wrote:
>
> I wonder if anyone has code for implementing unformatted I/O?
> What I have in mind is
> for the simple case where the application that reads data knows
> the data types, so
> this is not as complicated as the general marshalling situation.
>
> This proposal provides a very simple solution that works with standard
> library input and output streams. The one caveat is that the stream
> must be opened with filemode std::ios_base::binary to avoid certain
> data values being treated as line endings.

Slightly off topic: Any ideas how to require/detect/ensure that
std::ios_base::binary has been specified for a stream? This would have
saved me lot's of debug time with boost serialization's binary archive,
and in some spirit qi parsers.

Thanks, Jeff


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk