MCPcopy Create free account
hub / github.com/OneLoneCoder/olcPixelGameEngine / ConvertS2W

Method ConvertS2W

olcPixelGameEngine.h:6471–6485  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

6469 {
6470 private:
6471 std::wstring ConvertS2W(std::string s)
6472 {
6473#ifdef __MINGW32__
6474 wchar_t* buffer = new wchar_t[s.length() + 1];
6475 mbstowcs(buffer, s.c_str(), s.length());
6476 buffer[s.length()] = L'\0';
6477#else
6478 int count = MultiByteToWideChar(CP_UTF8, 0, s.c_str(), -1, NULL, 0);
6479 wchar_t* buffer = new wchar_t[count];
6480 MultiByteToWideChar(CP_UTF8, 0, s.c_str(), -1, buffer, count);
6481#endif
6482 std::wstring w(buffer);
6483 delete[] buffer;
6484 return w;
6485 }
6486
6487 public:
6488 ImageLoader_GDIPlus() : ImageLoader()

Callers

nothing calls this directly

Calls 1

lengthMethod · 0.80

Tested by

no test coverage detected