fix config path

This commit is contained in:
Callow
2022-07-13 13:40:16 +03:00
parent 1621b47975
commit 4d16211b6c
3 changed files with 15 additions and 4 deletions

View File

@ -62,6 +62,14 @@ namespace util
return (*c);
}
std::string GetModulePath(HMODULE hModule /*= nullptr*/)
{
char pathOut[MAX_PATH] = {};
GetModuleFileNameA(hModule, pathOut, MAX_PATH);
return std::filesystem::path(pathOut).parent_path().string();
}
std::optional<std::string> SelectDirectory(const char* title)
{
auto currPath = std::filesystem::current_path();

View File

@ -36,6 +36,8 @@ namespace util
std::string GetLastErrorAsString(DWORD errorId = 0);
int64_t GetCurrentTimeMillisec();
std::string GetModulePath(HMODULE hModule = nullptr);
std::vector<std::string> StringSplit(const std::string& delimiter, const std::string& content);
std::string SplitWords(const std::string& value);
std::string MakeCapital(std::string value);