MCPcopy Create free account
hub / github.com/OpenMW/openmw / DebugOutput

Class DebugOutput

components/debug/debugging.cpp:183–202  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

181
182#if defined _WIN32 && defined _DEBUG
183 class DebugOutput : public DebugOutputBase
184 {
185 public:
186 std::streamsize writeImpl(const char* str, std::streamsize size, Level debugLevel)
187 {
188 if (size > std::numeric_limits<int>::max())
189 OutputDebugStringW(L"Next line truncated...");
190 auto wideSize = MultiByteToWideChar(CP_UTF8, 0, str,
191 static_cast<int>(std::min<std::streamsize>(size, std::numeric_limits<int>::max())), nullptr, 0);
192 std::wstring wide(wideSize, L'\0');
193 MultiByteToWideChar(CP_UTF8, 0, str,
194 static_cast<int>(std::min<std::streamsize>(size, std::numeric_limits<int>::max())), wide.data(),
195 wideSize);
196 // Write string to Visual Studio Debug output
197 OutputDebugStringW(wide.c_str());
198 return size;
199 }
200
201 virtual ~DebugOutput() = default;
202 };
203#else
204
205 struct Record

Callers 1

wrapApplicationFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected