Hi!
I'm trying to redirect the output of print_data into a stringstream. I wrote the following code:
Foo *myFoo = Foo::TypeSupport::create_data();std::stringstream buffer;
std::streambuf * old = std::cout.rdbuf(buffer.rdbuf());
Foo::TypeSupport::print_data(myFoo);
std::string text = buffer.str(); // text will now contain "Bla\n"
std::cout.rdbuf(old);Foo::TypeSupport::delete_data(status);
But the ouput of print_data is still written in the standard output.
Note that if I replace "Foo::TypeSupport::print_data(myFoo)" by "std::cout << "Print MyFoo;", the string "Print MyFoo" is correctly saved in my buffer stringstream.
Do you know how is printed the print_data output ? Using a printf? Something else?
Thank you for your help :-)
Lucie