explicit StreamRedirector(std::ios& stream, std::streambuf* newBuf) : savedBuf_(stream.rdbuf()), stream_(stream) { stream_.rdbuf(newBuf); }
RedirectStreamBuffer(std::ios &stream, std::streambuf * new_sb) : stream(stream) { orig_sb = stream.rdbuf( new_sb ); }