31 inline wstring to_wstring(cstring_view stringView, 
const std::locale& locale = std::locale())
 
   35     std::vector<wchar_t> buf(stringView.size());
 
   36     std::use_facet<std::ctype<wchar_t>>(locale).widen(
 
   38         stringView.data() + stringView.size(),
 
   41     return wstring(buf.data(), buf.size());
 
   50 inline wstring to_wstring(wstring_view stringView, 
const std::locale& locale = std::locale())
 
   62 inline cstring to_cstring(wstring_view stringView, 
const std::locale& locale = std::locale())
 
   66     std::vector<char> buf(stringView.size());
 
   67     std::use_facet<std::ctype<wchar_t>>(locale)
 
   68         .narrow(stringView.data(), stringView.data() + stringView.size(), 
'?', buf.data());
 
   69     return cstring(buf.data(), buf.size());
 
   78 inline cstring to_cstring(cstring_view stringView, 
const std::locale& locale = std::locale())
 
   89 inline string to_string(cstring_view stringView, 
const std::locale& locale = std::locale())
 
   91 #ifdef QX_CONF_USE_CHAR 
   93 #elif defined(QX_CONF_USE_WCHAR) 
  104 inline string to_string(wstring_view stringView, 
const std::locale& locale = std::locale())
 
  106 #ifdef QX_CONF_USE_CHAR 
  108 #elif defined(QX_CONF_USE_WCHAR) 
  122 #ifdef QX_CONF_USE_WCHAR 
  126     const int nLength = MultiByteToWideChar(CP_UTF8, 0, pszUtf8.data(), 
static_cast<int>(pszUtf8.size()), 
nullptr, 0);
 
  127     string    sRet(nLength, QX_TEXT(
'\n'));
 
  128     MultiByteToWideChar(CP_UTF8, 0, pszUtf8.data(), 
static_cast<int>(pszUtf8.size()), sRet.data(), nLength);
 
  133     QX_PUSH_SUPPRESS_ALL_WARNINGS();
 
  134     std::wstring_convert<std::codecvt_utf8_utf16<wchar_t>> converter;
 
  135     return converter.from_bytes(pszUtf8.data(), pszUtf8.data() + pszUtf8.size());
 
  136     QX_POP_SUPPRESS_WARNINGS();
 
Contains perf scope macros for profiler (for internal usage only, but user may override them)
 
wstring to_wstring(cstring_view stringView, const std::locale &locale=std::locale())
convert cstring to wstring
 
string utf8_to_string(cstring_view pszUtf8)
Convert const char* representing UTF8 to wstring.
 
cstring to_cstring(wstring_view stringView, const std::locale &locale=std::locale())
Convert wstring to cstring.
 
string to_string(cstring_view stringView, const std::locale &locale=std::locale())
Convert a char string to common string type.