www.digitalmars.com Home | Search | C & C++ | D | DMDScript | News Groups | index | prev | next
Archives

D Programming
D
D.gnu
digitalmars.D
digitalmars.D.bugs
digitalmars.D.dtl
digitalmars.D.ide
digitalmars.D.dwt
digitalmars.D.announce
digitalmars.D.learn
digitalmars.D.debugger

C/C++ Programming
c++
c++.announce
c++.atl
c++.beta
c++.chat
c++.command-line
c++.dos
c++.dos.16-bits
c++.dos.32-bits
c++.idde
c++.mfc
c++.rtl
c++.stl
c++.stl.hp
c++.stl.port
c++.stl.sgi
c++.stlsoft
c++.windows
c++.windows.16-bits
c++.windows.32-bits
c++.wxwindows

digitalmars.empire
digitalmars.DMDScript
electronics




digitalmars.D - std.stream.OutputStream

↑ ↓ ← terranium <spam here.lot> writes:
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.
Apr 26 2008
→ "Janice Caron" <caron800 googlemail.com> writes:
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.
Apr 26 2008
Lars Ivar Igesund <larsivar igesund.net> writes:
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
Apr 26 2008
→ "Janice Caron" <caron800 googlemail.com> writes:
Personally, I tend to use the C functions, fopen(), fclose(), etc..
They're rock solid, bog standard, and work with both D1 and D2.
Apr 26 2008
terranium <spam here.lot> writes:
 I would recommend looking at the streams in Tango instead.

Apr 26 2008
↑ ↓ → Lars Ivar Igesund <larsivar igesund.net> writes:
terranium wrote:

 I would recommend looking at the streams in Tango instead.


Not yet, I'm afraid. -- Lars Ivar Igesund blog at http://larsivi.net DSource, #d.tango & #D: larsivi Dancing the Tango
Apr 26 2008