Streaming transport interfaces: input

Steven Schveighoffer schveiguy at yahoo.com
Thu Oct 14 20:00:27 PDT 2010


On Thu, 14 Oct 2010 19:30:21 -0400, Michel Fortin  
<michel.fortin at michelf.com> wrote:

> On 2010-10-14 16:47:13 -0400, "Steven Schveighoffer"  
> <schveiguy at yahoo.com> said:
>
>>> stream.position = StreamBase.atEnd;
>>  OK, that is acceptable.  What about seeking to N bytes before the end?
>>  What about seeking N bytes ahead of the current position (as  
>> previously  stated)?
>
> Would be nice if we could do all this:
>
> 	stream.position = $;
> 	stream.position = $-10;
> 	stream.position += 10;
>
> The last one (+=) should be only one function call to avoid two system  
> calls. All that's a little hard to implement though.

You could get close to this with some nifty type construction, but I'm  
unsure it's worth all that when the whole thing can be had via one  
function call (seek).

-Steve


More information about the Digitalmars-d mailing list