On Thu, Nov 30, 2006 at 10:05:52AM +0000, William S Fulton wrote:
> Steve M. Robbins wrote:
> > Howdy,
> > I creating a java wrapping of a library (DCMTK) that has methods with
> > a std::ostream parameter. Swig helpfully generates methods that
> > take a SWIGTYPE_p_ostream parameter. But I have no way of creating
> > such a beast (from java).
> > What I'd really like to do is write a typemap from a java OutputStream
> > or something so as to be able to use System.out. Any hints?
> You can get stdout... just create a function to return it.
True; I was sloppy in my phrasing.
What I'll likely do in the short term is create functions to return
std::cout, std::cerr, and another to open a file and return the
ostream for it.
But it sure would be nice not to have to wrap all of this kind of
stuff given that java already has a rich I/O library with streams
that go to sockets, memory buffers, etc.
P.S. I've posted the question to the Sun Developer Network