MCPcopy Create free account
hub / github.com/catboost/catboost / UTF8ToWCHAR

Function UTF8ToWCHAR

util/system/fs_win.cpp:12–21  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

10
11namespace NFsPrivate {
12 static LPCWSTR UTF8ToWCHAR(const TStringBuf str, TUtf16String& wstr) {
13 wstr.resize(str.size());
14 size_t written = 0;
15 if (!UTF8ToWide(str.data(), str.size(), wstr.begin(), written)) {
16 return nullptr;
17 }
18 wstr.erase(written);
19 static_assert(sizeof(WCHAR) == sizeof(wchar16), "expect sizeof(WCHAR) == sizeof(wchar16)");
20 return (const WCHAR*)wstr.data();
21 }
22
23 static TString WCHARToUTF8(const LPWSTR wstr, size_t len) {
24 static_assert(sizeof(WCHAR) == sizeof(wchar16), "expect sizeof(WCHAR) == sizeof(wchar16)");

Callers 8

CreateFileWithUtf8NameFunction · 0.70
WinRenameFunction · 0.70
WinRemoveFunction · 0.70
WinSymLinkFunction · 0.70
WinHardLinkFunction · 0.70
WinExistsFunction · 0.70
WinMakeDirectoryFunction · 0.70

Calls 6

UTF8ToWideFunction · 0.50
resizeMethod · 0.45
sizeMethod · 0.45
dataMethod · 0.45
beginMethod · 0.45
eraseMethod · 0.45

Tested by

no test coverage detected