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

Method ConsoleObserverFile

src/Base/ConsoleObserver.cpp:47–56  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

45// some special observers
46
47ConsoleObserverFile::ConsoleObserverFile(const char* sFileName)
48 : cFileStream(Base::FileInfo(sFileName)) // can be in UTF8
49{
50 if (!cFileStream.is_open()) {
51 Console().warning("Cannot open log file '%s'.\n", sFileName);
52 }
53 // mark the file as a UTF-8 encoded file
54 unsigned char bom[3] = {0xef, 0xbb, 0xbf};
55 cFileStream.write(reinterpret_cast<const char*>(bom), 3 * sizeof(char));
56}
57
58ConsoleObserverFile::~ConsoleObserverFile()
59{

Callers

nothing calls this directly

Calls 3

FileInfoClass · 0.70
warningMethod · 0.45
writeMethod · 0.45

Tested by

no test coverage detected