Thread overview
std.stream
Mar 16, 2005
novice2
Mar 16, 2005
Ben Hinkle
Mar 16, 2005
novice2
March 16, 2005
I have dmd 0.118 and need to parse string, contain xml.
But all xml libraries i found using stream as input data.
So i need construct stream from char[].
I found in TArrayStream!(char[]) in std.stream.
But can't compile small test program.
Any advices?

#---file t.d---

private import std.stream;

void main()
{
char[] myString = "test string";
TArrayStream!(char[]) myStream = new TArrayStream!(char[]) (myString);
}


#---linker error---
t.obj(t)
Error 42: Symbol Undefined _array_3std6stream
--- errorlevel 1


March 16, 2005
"novice2" <novice2_member@pathlink.com> wrote in message news:d18p7o$d7e$1@digitaldaemon.com...
>I have dmd 0.118 and need to parse string, contain xml.
> But all xml libraries i found using stream as input data.
> So i need construct stream from char[].
> I found in TArrayStream!(char[]) in std.stream.
> But can't compile small test program.
> Any advices?
>
> #---file t.d---
>
> private import std.stream;
>
> void main()
> {
> char[] myString = "test string";
> TArrayStream!(char[]) myStream = new TArrayStream!(char[]) (myString);
> }
>
>
> #---linker error---
> t.obj(t)
> Error 42: Symbol Undefined _array_3std6stream
> --- errorlevel 1

Use MemoryStream instead. It has a constructor that takes a char[] even
though I notice that isn't listed in the doc. I will send Walter a update
for that.
The error using TArrayStream is probably due to building in debug mode but
linking against a non-debug build of phobos. So I'll probably remove
TArrayStream from the doc since it is a pain to work with (you must
pass -release to dmd). Either that or dmd.zip needs to include debug and
non-debug builds of phobos.


March 16, 2005
>Use MemoryStream instead

Thank you very much!
It works.