deprecating std.stream, std.cstream, std.socketstream

Stewart Gordon smjg_1998 at yahoo.com
Mon May 14 04:43:20 PDT 2012


 From the other thread....

On 13/05/2012 21:58, Walter Bright wrote:
> On 5/13/2012 1:48 PM, Stewart Gordon wrote:
>> On 13/05/2012 20:42, Walter Bright wrote:
>> <snip>
>>> I'd like to see std.stream dumped.  I don't see any reason for it
>>> to exist that std.stdio doesn't do (or should do).
>>
>> So std.stdio.File is the replacement for the std.stream stuff?
>
> Not exactly.  Ranges are the replacement.  std.stdio.File is merely
> a range that deals with files.

I don't see any of the required range methods in it.

Moreover, I'm a bit confused about the means of retrieving multiple elements at once with 
the range API, such as a set number of bytes from a file.  We have popFrontN, which 
advances the range but doesn't return the data from it.  We have take and takeExactly, 
which seem to be the way to get a set number of elements from the range, but I'm confused 
about when/whether using these advances the original range.

If I'm writing a library to read a binary file format, I want to allow the data to come 
from a file, a socket or a memory image.  The stream API makes this straightforward.  But 
it seems some work is needed before std.stdio and the range API are up to it.

Stewart.


More information about the Digitalmars-d mailing list