Boost logo

Boost :

From: Jonathan Turkanis (technews_at_[hidden])
Date: 2005-02-28 18:08:54

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:


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);

    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 << "LINE ONE" << endl
            << "Next line" << endl
            << "third line" << endl;


Boost list run by bdawes at, gregod at, cpdaniel at, john at