refactor: change 2 functions declarations in WinFctHelper

- update GetTempPath and GetModuleName function to let them more reliable.
This commit is contained in:
2024-06-15 16:44:11 +08:00
parent c32806ea03
commit d0a8733379
4 changed files with 113 additions and 45 deletions

View File

@ -33,18 +33,22 @@ namespace YYCC::WinFctHelper {
/**
* @brief Get path to Windows temp folder.
* @return UTF8 encoded path to Windows temp folder. Empty string if failed.
* @param[out] ret
* The variable receiving UTF8 encoded path to Windows temp folder.
* @return True if success, otherwise false.
*/
std::string GetTempDirectory();
bool GetTempDirectory(std::string& ret);
/**
* @brief Get the file name of given module HANDLE
* @param[in] hModule
* The HANDLE to the module where we want get file name.
* It is same as the HANDLE parameter of \c GetModuleFileName.
* @return UTF8 encoded file name of given module. Empty string if failed.
* @param[out] ret
* The variable receiving UTF8 encoded file name of given module.
* @return True if success, otherwise false.
*/
std::string GetModuleName(HINSTANCE hModule);
bool GetModuleName(HINSTANCE hModule, std::string& ret);
}
#endif