MCPcopy Create free account
hub / github.com/FreeCAD/FreeCAD / Redirection

Method Redirection

src/Main/MainGui.cpp:74–86  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

72{
73public:
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);

Callers

nothing calls this directly

Calls 3

toStdWStringMethod · 0.80
c_strMethod · 0.45
filePathMethod · 0.45

Tested by

no test coverage detected