feat: add getExePath

This commit is contained in:
2026-04-09 06:40:34 -03:00
parent d4650aac84
commit a3df782245
2 changed files with 22 additions and 0 deletions
+14
View File
@@ -0,0 +1,14 @@
#include "utils.h"
#include <minwindef.h>
#include <libloaderapi.h>
std::string utils::getExePath()
{
char buffer[MAX_PATH];
GetModuleFileNameA(NULL, buffer, MAX_PATH);
std::string path(buffer);
size_t pos = path.find_last_of("\\/");
if (pos != std::string::npos) return path.substr(0, pos + 1);
return "";
}
+8
View File
@@ -0,0 +1,8 @@
#pragma once
#include <string>
namespace utils
{
std::string getExePath();
}