Read/write structs in streams (Tango, and Strings)

Robert Kosek robert.kosek at thewickedflea.com
Wed Oct 22 08:11:32 PDT 2008


Bill Baxter wrote:
> On Wed, Oct 22, 2008 at 11:24 PM, Steven Schveighoffer
> <schveiguy at yahoo.com> wrote:
> [...] 
> And yes you need some kind of library if you want to stream arbitrary
> structs which may or may not contain pointers to disk.   And no,
> neither Tango nor Phobos has such a library.
> 
> --bb


Okay, thanks.  To write a struct to a stream should really be like 
writing a buffer.  You point the writer at the memory and tell it how 
large it is, and it writes the block to the stream.  So it should to be 
able to write a pointer-less struct.

That much is good, I can do string mangling/storage another way, probably.

Thanks for the answers Bill and Steven.

Robert


More information about the Digitalmars-d-learn mailing list