mirror of
https://github.com/cemu-project/Cemu.git
synced 2024-12-02 05:54:18 +01:00
27 lines
618 B
C++
27 lines
618 B
C++
#pragma once
|
|
#include <wx/string.h>
|
|
|
|
namespace wxHelper
|
|
{
|
|
// wxString to utf8 std::string
|
|
inline std::string MakeUTF8(const wxString& str)
|
|
{
|
|
auto tmpUtf8 = str.ToUTF8();
|
|
return std::string(tmpUtf8.data(), tmpUtf8.length());
|
|
}
|
|
|
|
inline fs::path MakeFSPath(const wxString& str)
|
|
{
|
|
auto tmpUtf8 = str.ToUTF8();
|
|
auto sv = std::basic_string_view<char8_t>((const char8_t*)tmpUtf8.data(), tmpUtf8.length());
|
|
return fs::path(sv);
|
|
}
|
|
|
|
inline wxString FromUtf8(std::string_view str)
|
|
{
|
|
return wxString::FromUTF8(str.data(), str.size());
|
|
}
|
|
|
|
|
|
};
|