wxInputStream/wxOutputStream to C++ i/ostream delegation

Vadim Zeitlin vadim at wxwidgets.org
Wed Sep 5 09:07:53 PDT 2007


On Wed, 05 Sep 2007 10:48:01 -0400 "T.J. VanSlyke" <tvanslyke at psdconsulting.com> wrote:

TV> The methods
TV> 
TV>       virtual ostream& in() = 0;
TV>       virtual istream& out() = 0;
TV> 
TV> pose a problem as I am not sure whether it is possible to delegate the 
TV> wxInput/OutputStream classes to istream and ostream, respectively.  

 Unless I'm mistaken, you need to the converse: that is implement an
std::stream which delegates to wxStream.

TV> Essentially, I need to return a std::ostream and a std::istream which 
TV> forward their stream I/O requests to their wx counterparts.

 I've never done this but I think it should be possible. If not, we ought
to extend wxStreams to provide the necessary missing functionality. And if
you manage to write a generic wxStreams-as-std::stream wrapper class,
please consider submitting it for inclusion into wxWidgets itself as I
think it would be useful for others too.

 Good luck,
VZ

-- 
TT-Solutions: wxWidgets consultancy and technical support
               http://www.tt-solutions.com/





More information about the wx-users mailing list