MCPcopy Create free account
hub / github.com/CobaltFusion/DebugViewPP / WideCharToMultiByte

Function WideCharToMultiByte

Win32Lib/Win32Lib.cpp:113–119  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

111}
112
113std::string WideCharToMultiByte(const wchar_t* str, int len)
114{
115 int buf_size = len*2 + 2;
116 std::vector<char> buf(buf_size);
117 int write_len = ::WideCharToMultiByte(0, 0, str, len, buf.data(), buf.size(), nullptr, nullptr);
118 return std::string(buf.data(), buf.data() + write_len);
119}
120
121std::string WideCharToMultiByte(const wchar_t* str)
122{

Callers 2

ThrowLastErrorFunction · 0.85
StrMethod · 0.85

Calls 3

dataMethod · 0.80
sizeMethod · 0.45
c_strMethod · 0.45

Tested by

no test coverage detected