| Thread overview | ||||||||
|---|---|---|---|---|---|---|---|---|
|
April 26, 2008 std.stream.OutputStream | ||||
|---|---|---|---|---|
| ||||
OutputStream has writeStringW and printf methods, but in what encoding characters are written to the stream? As I can see there is no division to *byte* streams and *text* writers as in .Net. | ||||
April 26, 2008 Re: std.stream.OutputStream | ||||
|---|---|---|---|---|
| ||||
Posted in reply to terranium | On 26/04/2008, terranium <spam@here.lot> wrote:
> OutputStream has writeStringW and printf methods, but in what encoding characters are written to the stream?
> As I can see there is no division to *byte* streams and *text* writers as in .Net.
I don't know for sure, but I suspect that the implementation probably just writes without validating, so you could probably get away with just casting a ubyte array to to a char array.
That said, std.stream is antiquated. I believe it was one of the earliest Phobos libraries, and I suspect it was written largely to avoid dependency on C functions. Phobos streams are long overdue for a revamp, and that may well happen sooner rather than later.
| |||
April 26, 2008 Re: std.stream.OutputStream | ||||
|---|---|---|---|---|
| ||||
Posted in reply to terranium | terranium wrote: > OutputStream has writeStringW and printf methods, but in what encoding characters are written to the stream? As I can see there is no division to *byte* streams and *text* writers as in .Net. I would recommend looking at the streams in Tango instead. -- Lars Ivar Igesund blog at http://larsivi.net DSource, #d.tango & #D: larsivi Dancing the Tango | |||
April 26, 2008 Re: std.stream.OutputStream | ||||
|---|---|---|---|---|
| ||||
Posted in reply to Lars Ivar Igesund | Personally, I tend to use the C functions, fopen(), fclose(), etc.. They're rock solid, bog standard, and work with both D1 and D2. | |||
April 26, 2008 Re: std.stream.OutputStream | ||||
|---|---|---|---|---|
| ||||
Posted in reply to Lars Ivar Igesund | > I would recommend looking at the streams in Tango instead.
does it work with dmd2?
| |||
April 26, 2008 Re: std.stream.OutputStream | ||||
|---|---|---|---|---|
| ||||
Posted in reply to terranium | terranium wrote: >> I would recommend looking at the streams in Tango instead. > does it work with dmd2? Not yet, I'm afraid. -- Lars Ivar Igesund blog at http://larsivi.net DSource, #d.tango & #D: larsivi Dancing the Tango | |||
Copyright © 1999-2021 by the D Language Foundation
Permalink
Reply