Stream Proposal

Kagamin spam at here.lot
Tue Mar 15 06:29:31 PDT 2011


Andrei Alexandrescu Wrote:

> >> T[] getBuffer(size_t n);
> >> void commitBuffer(size_t n);
> >
> > void put(T); // as usual
> > void put(T[]); // bulk put; can pass a slice of the buffer from getBuffer
> 
> This is already implemented but doesn't allow someone to play with the 
> buffer and then commit it. Arguably there might be no such need.

Imagine you played with the buffer and only buffer[2..6] and buffer[9..13] should go to the storage. Say, you're converting from xml to plain text. You just skip markup and optionally unescape entities.


More information about the Digitalmars-d mailing list