Boost logo

Boost :

From: Philippe Vaucher (philippe.vaucher_at_[hidden])
Date: 2007-03-09 11:04:42


I'm trying to get boost::iostream::stream to work in non buffered mode,
because atm I have something like :

std::streamsize read(char* s, std::streamsize n)
    DWORD total;
    if(!ReadFile(m_handle.get(), s, 1, &total, 0))
       throw device_error(GetLastError());
    return total;

And this works, but my 1st try was to use "n" instead of "1", but then it
blocked because n is 4096, even when I do a simple .get() on my stream.

I saw there was a :

stream( const T& t, std::streamsize buffer_size, std::streamsize pback_size

constructor, and I tried to use it like, stream s(mystreambuf, 0, 0); but it
kept asking for 4096 bytes.

The boost::iostream buffered/non-buffered part of the documentation simply
says :

3.11 Buffering
[To be supplied in the next release]

So it looks like I'm stuck :)
Thank you for your help.


Boost list run by bdawes at, gregod at, cpdaniel at, john at