7#ifndef TWOBLUECUBES_CATCH_OUTPUT_REDIRECT_H
8#define TWOBLUECUBES_CATCH_OUTPUT_REDIRECT_H
20 std::ostream& m_originalStream;
21 std::ostream& m_redirectionStream;
22 std::streambuf* m_prevBuf;
25 RedirectedStream( std::ostream& originalStream, std::ostream& redirectionStream );
34 auto str()
const -> std::string;
46 auto str()
const -> std::string;
59 std::string& m_redirectedCout;
60 std::string& m_redirectedCerr;
65#if defined(CATCH_CONFIG_NEW_CAPTURE)
82 std::string getContents();
85 std::FILE* m_file =
nullptr;
87 char m_buffer[L_tmpnam] = { 0 };
92 class OutputRedirect {
94 OutputRedirect(OutputRedirect
const&) =
delete;
95 OutputRedirect& operator=(OutputRedirect
const&) =
delete;
96 OutputRedirect(OutputRedirect&&) =
delete;
97 OutputRedirect& operator=(OutputRedirect&&) =
delete;
100 OutputRedirect(std::string& stdout_dest, std::string& stderr_dest);
104 int m_originalStdout = -1;
105 int m_originalStderr = -1;
108 std::string& m_stdoutDest;
109 std::string& m_stderrDest;
auto str() const -> std::string
auto str() const -> std::string
RedirectedStream(std::ostream &originalStream, std::ostream &redirectionStream)
RedirectedStreams(RedirectedStreams &&)=delete
RedirectedStreams & operator=(RedirectedStreams &&)=delete
RedirectedStreams(RedirectedStreams const &)=delete
RedirectedStreams & operator=(RedirectedStreams const &)=delete
FILE * TempFile(char *filename)