| 72 | { |
| 73 | public: |
| 74 | Redirection(FILE* f) |
| 75 | : fi(Base::FileInfo::getTempFileName()) |
| 76 | , file(f) |
| 77 | { |
| 78 | #ifdef WIN32 |
| 79 | FILE* ptr = _wfreopen(fi.toStdWString().c_str(), L"w", file); |
| 80 | #else |
| 81 | FILE* ptr = freopen(fi.filePath().c_str(), "w", file); |
| 82 | #endif |
| 83 | if (!ptr) { |
| 84 | std::cerr << "Failed to reopen file" << std::endl; |
| 85 | } |
| 86 | } |
| 87 | ~Redirection() |
| 88 | { |
| 89 | fclose(file); |
nothing calls this directly
no test coverage detected