Renamed RedirectInputOutput -> RedirectOutputError
This class does not redirect input.
This commit is contained in:
parent
77089293c6
commit
10396911ca
|
@ -6,10 +6,10 @@
|
||||||
extern std::ostringstream errout;
|
extern std::ostringstream errout;
|
||||||
extern std::ostringstream output;
|
extern std::ostringstream output;
|
||||||
|
|
||||||
class RedirectInputOutput
|
class RedirectOutputError
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
RedirectInputOutput()
|
RedirectOutputError()
|
||||||
{
|
{
|
||||||
// flush all old output
|
// flush all old output
|
||||||
std::cout.flush();
|
std::cout.flush();
|
||||||
|
@ -22,7 +22,7 @@ public:
|
||||||
std::cerr.rdbuf(_err.rdbuf()); // assign streambuf to cerr
|
std::cerr.rdbuf(_err.rdbuf()); // assign streambuf to cerr
|
||||||
}
|
}
|
||||||
|
|
||||||
~RedirectInputOutput()
|
~RedirectOutputError()
|
||||||
{
|
{
|
||||||
std::cout.rdbuf(_oldCout); // restore cout's original streambuf
|
std::cout.rdbuf(_oldCout); // restore cout's original streambuf
|
||||||
std::cerr.rdbuf(_oldCerr); // restore cerrs's original streambuf
|
std::cerr.rdbuf(_oldCerr); // restore cerrs's original streambuf
|
||||||
|
@ -38,6 +38,6 @@ private:
|
||||||
std::streambuf *_oldCerr;
|
std::streambuf *_oldCerr;
|
||||||
};
|
};
|
||||||
|
|
||||||
#define REDIRECT RedirectInputOutput redir;
|
#define REDIRECT RedirectOutputError redir;
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
Loading…
Reference in New Issue