51#ifndef GUM_CAST_UNICODE_H
52# define GUM_CAST_UNICODE_H
63INLINE std::wstring
widen(std::string_view str) {
64 std::wostringstream wstm;
65 const std::ctype< wchar_t >& ctfacet = std::use_facet< std::ctype< wchar_t > >(wstm.getloc());
67 for (
size_t i = 0; i < str.size(); ++i) {
68 wstm << ctfacet.widen(str[i]);
74INLINE std::string
narrow(
const std::wstring& str) {
75 std::ostringstream stm;
76 const std::ctype< char >& ctfacet = std::use_facet< std::ctype< char > >(stm.getloc());
78 for (std::size_t i = 0; i < str.size(); ++i) {
79 stm << ctfacet.narrow(str[i], 0);
Unicode helper functions.
INLINE std::wstring widen(std::string_view str)
Cast a std::string into a std::wstring.
INLINE std::string narrow(const std::wstring &str)
Cast a std::wstring into a std::string.
aGrUM's inline/outline selection