MCPcopy Create free account
hub / github.com/Rectus/openxr-steamvr-passthrough / GetProcessFileName

Function GetProcessFileName

shared/pathutil.cpp:52–66  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

50}
51
52std::string GetProcessFileName(bool bIncludeExtension)
53{
54 wchar_t buffer[MAX_PATH] = { 0 };
55 GetModuleFileNameW(NULL, buffer, MAX_PATH);
56 std::string filePath = ToUTF8String(buffer);
57 std::string fileName = filePath.substr(filePath.find_last_of("/\\") + 1);
58 if (bIncludeExtension)
59 {
60 return fileName;
61 }
62 else
63 {
64 return std::string(fileName.substr(0, fileName.find_last_of(".")));
65 }
66}
67
68bool CreateDirectoryPath(const std::string_view& path)
69{

Calls 1

ToUTF8StringFunction · 0.85

Tested by

no test coverage detected