3#include "../IBaseApi.h"
4#include "../PluginManager/PluginManager.h"
10 char buffer[MAX_PATH];
11 GetModuleFileNameA(
nullptr, buffer, MAX_PATH);
13 const std::string::size_type pos = std::string(buffer).find_last_of(
"\\/");
15 return std::string(buffer).substr(0, pos);
18 std::string Utf8Encode(
const std::wstring& wstr)
20 std::string converted_string;
23 return converted_string;
25 const auto size_needed = WideCharToMultiByte(CP_UTF8, 0, wstr.data(),
static_cast<
int>(wstr.size()),
nullptr, 0,
29 converted_string.resize(size_needed);
31 WideCharToMultiByte(CP_UTF8, 0, wstr.data(),
static_cast<
int>(wstr.size()), converted_string.data(),
32 size_needed,
nullptr,
nullptr);
35 return converted_string;
38 std::wstring Utf8Decode(
const std::string& str)
40 std::wstring converted_string;
44 return converted_string;
47 const auto size_needed = MultiByteToWideChar(CP_UTF8, 0, str.data(),
static_cast<
int>(str.size()),
nullptr, 0);
50 converted_string.resize(size_needed);
52 MultiByteToWideChar(CP_UTF8, 0, str.data(),
static_cast<
int>(str.size()), converted_string.data(),
56 return converted_string;
59 bool IsPluginLoaded(
const std::string& plugin_name)
61 return API::PluginManager::Get().IsPluginLoaded(plugin_name);
66 return API::game_api->GetVersion();