
Brian Braatz wrote:
First off THANK YOU Johnathon Turkanis for help with "tee" earlier. That saved me a great amount of pain.
Glad to be of service ;-)
Below is part of what I am trying to use it with.
My next question is what is the best way to deal with an "output" device having a different cr\lf than another one?
Have you tried to use a newline filter: http://www.kangaroologic.com/iostreams/libs/iostreams/doc/?path=6.2.2 ? I'm not familiar with the function OutputDebugString, but you might be able to do this: struct debug_out_sink : boost::iostreams::sink { void write(const char* s, std::streamsize n) { std::string s(s, n); OutputDebugString(s.c_str()); } }; void Test_Profile() { // Note: library now uses namespace iostreams using namespace boost::iostreams; filtering_ostream out; std::ofstream log("log.txt"); debug_out_sink dbosink; out.push(tee(log)); out.push(tee(std::cout)); out.push(newline_filter(newline::windows)); out.push(dbosink); out << "LINE ONE" << endl << "Next line" << endl << "third line" << endl; } Jonathan