Menu

#5 Use TextReader and TextWriter

open
nobody
5
2004-09-28
2004-09-28
dpbarron
No

Instead of using StreamReader and StreamWriter for
input and output, it would be nice to be able to use
TextReader and TextWriter. Also, the output stream
should be allowed to be null.

I am working on a project where I am either passed a
file name or a string to parse, and there is no concept
of "standard output" -- I have to log errors WITHOUT
using a TextWriter.

This is easy to do in Flex when generating C++ code
because they use istream and ostream instead of
ifstream and ofstream, and allow ofstream to be null.

I've done the work myself (it's trivial), but am not
sure of whether this is generally applicable.

Discussion


Log in to post a comment.

MongoDB Logo MongoDB