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

Function UTF8ToWCHAR

util/system/fs_win_ut.cpp:20–29  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

18}
19
20static LPCWSTR UTF8ToWCHAR(const TStringBuf str, TUtf16String& wstr) {
21 wstr.resize(str.size());
22 size_t written = 0;
23 if (!UTF8ToWide(str.data(), str.size(), wstr.begin(), written)) {
24 return nullptr;
25 }
26 wstr.erase(written);
27 static_assert(sizeof(WCHAR) == sizeof(wchar16), "expect sizeof(WCHAR) == sizeof(wchar16)");
28 return (const WCHAR*)wstr.data();
29}
30
31Y_UNIT_TEST_SUITE(TFsWinTest) {
32 Y_UNIT_TEST(TestRemoveDirWithROFiles) {

Callers 1

Y_UNIT_TESTFunction · 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