From: Daryle Walker (darylew_at_[hidden])
Date: 2001-08-06 14:44:35
on 8/5/01 6:44 PM, Nicolai Josuttis at nico_at_[hidden] wrote:
> Attached is a first draft of some new classes for boost. Their are provided to
> handle file descriptors and file handles with C++ stream interface.
> This is an often asked issue and I have seen that my class for writing on file
> descriptors is used and referenced a lot. Thus, it was time to take the next
> step to get a standardized way for low-level C++ I/O.
> This is the first draft. As you can see, there are a lot of open issues. Help
> me, to fix them.
> But NOTE: I have no time to read all BOOST messages. Please also send any
> improvement and fix directly to: nico_at_[hidden]
The file descriptor concept is not universal; it only exists for UNIX-style
and UNIX-wannabe operating systems. I have something like this class, but
using std::FILE*, in the more_io package in the vault. Someone else also
has this concept in the vault. My package also contains several stream
class that are easily derived from their streambuf classes using
base-from-member adapters. (These adapters are being Boost-reviewed, by
themselves, right now, so everyone should look at them for evaluation.)
For the file descriptors, why don't you combine the input and output into
one streambuf class?
//#include header for read, write, and BUFSIZE
: public std::streambuf
explicit fdbuf( int fd );
int get_fd() const;
int_type overflow( int_type c );
std::streamsize xsputn( char_type const *s, std::streamsize n );
std::streamsize xsgetn( char_type *s, std::streamsize n );
char_type buf_[ BUFSIZE ];
-- Daryle Walker Mac, Internet, and Video Game Junkie darylew AT mac DOT com
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk