Boost logo

Boost :

Subject: Re: [boost] [iostream] Device::read return inconsistency
From: eg (egoots_at_[hidden])
Date: 2009-05-08 13:23:24


Richard Smith wrote:
>
> The example in the documentation for the Source concept in
> Boost.Iostreams says:
>
> std::streamsize read(char* s, std::streamsize n)
> {
> // Read up to n characters from the input
> // sequence into the buffer s, returning
> // the number of characters read, or -1
> // to indicate end-of-sequence.
> }
>
> (The same text appears in 'valid expressions / semantics' table, which
> is probably more definitive.)
>
> What does a return of less than n actually mean?

I think the tutorial example for the multi-char shell comments filter
gives an example of one such case (c == WOULD_BLOCK).

see:
http://www.boost.org/doc/libs/1_39_0/libs/iostreams/doc/tutorial/multichar_filters.html#shell_comments_multichar_input_filter

The meaning of WOULD_BLOCK is mentioned in the section where they create
this same filter as a regular input filter.

http://www.boost.org/doc/libs/1_39_0/libs/iostreams/doc/tutorial/shell_comments_filters.html#shell_comments_input_filter


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