MCPcopy Create free account
hub / github.com/awslabs/aws-lambda-cpp / StreamWideCharsToMessage

Function StreamWideCharsToMessage

tests/gtest/gtest-all.cc:2410–2422  ·  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

2408// Converts an array of wide chars to a narrow string using the UTF-8
2409// encoding, and streams the result to the given Message object.
2410static void StreamWideCharsToMessage(const wchar_t* wstr, size_t length,
2411 Message* msg) {
2412 for (size_t i = 0; i != length; ) { // NOLINT
2413 if (wstr[i] != L'\0') {
2414 *msg << WideStringToUtf8(wstr + i, static_cast<int>(length - i));
2415 while (i != length && wstr[i] != L'\0')
2416 i++;
2417 } else {
2418 *msg << '\0';
2419 i++;
2420 }
2421 }
2422}
2423
2424#endif // GTEST_HAS_STD_WSTRING
2425

Callers 1

gtest-all.ccFile · 0.85

Calls 1

WideStringToUtf8Function · 0.85

Tested by

no test coverage detected