MCPcopy Create free account
hub / github.com/dobin/RedEdr / string2wstring

Function string2wstring

RedEdrShared/utils.cpp:471–480  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

469
470
471std::wstring string2wstring(const std::string& str) {
472 if (str.empty()) {
473 return {};
474 }
475
476 int size_needed = MultiByteToWideChar(CP_UTF8, 0, str.c_str(), static_cast<int>(str.size()), nullptr, 0);
477 std::wstring result(size_needed, 0);
478 MultiByteToWideChar(CP_UTF8, 0, str.c_str(), static_cast<int>(str.size()), &result[0], size_needed);
479 return result;
480}
481
482
483bool wstring_starts_with(const std::wstring& str, const std::wstring& prefix) {

Callers

nothing calls this directly

Calls 2

emptyMethod · 0.80
sizeMethod · 0.45

Tested by

no test coverage detected