McRogueFace Python API (McRFPy_API) demo class

This commit is contained in:
John McCardle 2023-02-25 22:14:00 -05:00
commit 6a2c3c6c36
7 changed files with 245 additions and 0 deletions

View file

@ -15,10 +15,26 @@ std::wstring executable_path()
}
std::wstring executable_filename()
{
auto exec_path = std::filesystem::canonical("/proc/self/exe");
return exec_path.wstring();
}
std::wstring working_path()
{
auto cwd = std::filesystem::current_path();
return cwd.wstring();
}
std::string narrow_string(std::wstring convertme)
{
//setup converter
using convert_type = std::codecvt_utf8<wchar_t>;
std::wstring_convert<convert_type, wchar_t> converter;
//use converter (.to_bytes: wstr->str, .from_bytes: str->wstr)
return converter.to_bytes(convertme);
}
#endif