renderd7/source/StealConsole.cpp

24 lines
577 B
C++
Raw Normal View History

#include <iostream>
#include <renderd7/StealConsole.hpp>
namespace RenderD7 {
StealConsole::StealConsole() {
std::streambuf *old = std::cout.rdbuf(this->stolen_stdout.rdbuf());
if (old) {
// To prevent from unused error
}
}
StealConsole::~StealConsole() {
// Do Nothing Here
}
std::string StealConsole::GetStdout() {
if (this->stolen_stdout.str().length() < 400) {
return this->stolen_stdout.str();
} else {
return this->stolen_stdout.str().substr(stolen_stdout.str().length() - 400);
}
return "";
}
2022-11-14 15:25:26 +01:00
} // namespace RenderD7