MCPcopy Create free account
hub / github.com/OpenSteam001/OpenSteamTool / WidePathToUtf8

Function WidePathToUtf8

src/OSTPlatform/Windows/DynamicLibrary.cpp:16–22  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

14constexpr DWORD kMaxWin32PathBuffer = 32768;
15
16std::string WidePathToUtf8(std::wstring_view path, const char* operation) {
17 std::string result = Encoding::WideToUtf8(path);
18 if (result.empty() && !path.empty()) {
19 OSTP_LOG_DEBUG("{}: failed to convert path to UTF-8", operation);
20 }
21 return result;
22}
23
24std::filesystem::path ModuleFilePath(HMODULE module, const char* operation) {
25 for (DWORD capacity = MAX_PATH; capacity <= kMaxWin32PathBuffer; capacity *= 2) {

Callers 1

DirectoryFromQueryFunction · 0.85

Calls 2

WideToUtf8Function · 0.85
emptyMethod · 0.80

Tested by

no test coverage detected