MCPcopy Create free account
hub / github.com/EmbeddedRPC/erpc / StreamWideCharsToMessage

Function StreamWideCharsToMessage

test/common/gtest/gtest.cpp:2395–2407  ·  view source on GitHub ↗

Converts an array of wide chars to a narrow string using the UTF-8 encoding, and streams the result to the given Message object.

Source from the content-addressed store, hash-verified

2393// Converts an array of wide chars to a narrow string using the UTF-8
2394// encoding, and streams the result to the given Message object.
2395static void StreamWideCharsToMessage(const wchar_t* wstr, size_t length,
2396 Message* msg) {
2397 for (size_t i = 0; i != length; ) { // NOLINT
2398 if (wstr[i] != L'\0') {
2399 *msg << WideStringToUtf8(wstr + i, static_cast<int>(length - i));
2400 while (i != length && wstr[i] != L'\0')
2401 i++;
2402 } else {
2403 *msg << '\0';
2404 i++;
2405 }
2406 }
2407}
2408
2409#endif // GTEST_HAS_STD_WSTRING || GTEST_HAS_GLOBAL_WSTRING
2410

Callers 1

gtest.cppFile · 0.85

Calls 1

WideStringToUtf8Function · 0.85

Tested by

no test coverage detected