MCPcopy Create free account
hub / github.com/TombEngine/TombEngine / GetBinaryPath

Function GetBinaryPath

TombEngine/Specific/trutils.cpp:225–244  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

223 }
224
225 std::wstring GetBinaryPath(bool includeExeName)
226 {
227 static const int MAX_PATH_LENGTH = 1024;
228 wchar_t fileName[MAX_PATH_LENGTH] = {};
229
230 if (!GetModuleFileNameW(nullptr, fileName, MAX_PATH_LENGTH))
231 {
232 TENLog("Can't get current assembly path", LogLevel::Error);
233 return std::wstring();
234 }
235
236 auto result = std::wstring(fileName);
237 std::replace(result.begin(), result.end(), '\\', '/');
238
239 if (includeExeName)
240 return result;
241
242 size_t pos = result.find_last_of(L"/");
243 return (pos != std::wstring::npos) ? result.substr(0, pos + 1) : std::wstring();
244 }
245
246 std::vector<unsigned short> GetProductOrFileVersion(bool productVersion)
247 {

Callers 2

GetProductOrFileVersionFunction · 0.85
InitializeMethod · 0.85

Calls 3

TENLogFunction · 0.85
beginMethod · 0.45
endMethod · 0.45

Tested by

no test coverage detected