3#include "PluginManager/PluginManager.h"
10 GetModuleFileNameA(
nullptr, buffer, MAX_PATH);
12 const std::string::size_type pos = std::string(buffer).find_last_of(
"\\/");
14 return std::string(buffer).substr(0, pos);
17 std::wstring ConvertToWideStr(
const std::string& text)
19 const size_t size = text.size();
26 size_t converted_chars;
27 mbstowcs_s(&converted_chars, wstr.data(), size + 1, text.c_str(), _TRUNCATE);
33 std::string ConvertToAnsiStr(
const std::wstring& text)
35 const size_t length = text.size();
37 std::string str(length,
'\0');
38 std::use_facet<std::ctype<
wchar_t>>(std::locale()).narrow(text.c_str(), text.c_str() + length,
'?', str.data());
43 std::string Utf8Encode(
const std::wstring& wstr)
48 const int size_needed = WideCharToMultiByte(CP_UTF8, 0, wstr.data(),
static_cast<
int>(wstr.size()),
nullptr, 0,
nullptr,
nullptr);
50 std::string str(size_needed, 0);
51 WideCharToMultiByte(CP_UTF8, 0, wstr.data(),
static_cast<
int>(wstr.size()), str.data(), size_needed,
nullptr,
nullptr);
56 std::wstring Utf8Decode(
const std::string& str)
59 return std::wstring();
61 const int size_needed = MultiByteToWideChar(CP_UTF8, 0, str.data(),
static_cast<
int>(str.size()),
nullptr, 0);
63 std::wstring wstr(size_needed, 0);
64 MultiByteToWideChar(CP_UTF8, 0, str.data(),
static_cast<
int>(str.size()), wstr.data(), size_needed);
69 bool IsPluginLoaded(
const std::string& plugin_name)
71 return PluginManager::Get().IsPluginLoaded(plugin_name);