MCPcopy Create free account
hub / github.com/SpartanJ/eepp / stringToWideString

Function stringToWideString

src/modules/eterm/src/eterm/system/process.cpp:244–251  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

242namespace eterm { namespace System {
243
244static std::wstring stringToWideString( const std::string& str ) {
245 if ( str.empty() )
246 return std::wstring();
247 int size_needed = MultiByteToWideChar( CP_UTF8, 0, &str[0], (int)str.size(), NULL, 0 );
248 std::wstring wstrTo( size_needed, 0 );
249 MultiByteToWideChar( CP_UTF8, 0, &str[0], (int)str.size(), &wstrTo[0], size_needed );
250 return wstrTo;
251}
252
253#define HANDLE_WIN_ERR( err ) HRESULT_FROM_WIN32( err ), PrintWinApiError( err )
254

Callers 2

createWithPipeMethod · 0.85

Calls 2

emptyMethod · 0.45
sizeMethod · 0.45

Tested by

no test coverage detected