12 RedirectCout() : ssBuffer_(), coutBuffer_(std::cout.rdbuf(ssBuffer_.rdbuf())) {}
15 std::string
str()
const {
16 return ssBuffer_.str();
21 std::cout.rdbuf(coutBuffer_);
25 std::stringstream ssBuffer_;
26 std::streambuf* coutBuffer_;
Global functions in a separate testing namespace.
Definition: chartTesting.h:28
For Python str().
Definition: utilities.h:10
~RedirectCout()
destructor – redirect stdout buffer to its original buffer
Definition: utilities.h:20
std::string str() const
return the string
Definition: utilities.h:15
RedirectCout()
constructor – redirect stdout buffer to a stringstream buffer
Definition: utilities.h:12