MCPcopy Create free account
hub / github.com/OpenStarbound/OpenStarbound / StreamWideCharsToMessage

Function StreamWideCharsToMessage

source/test/gtest/src/gtest.cc:1218–1229  ·  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

1216// Converts an array of wide chars to a narrow string using the UTF-8
1217// encoding, and streams the result to the given Message object.
1218static void StreamWideCharsToMessage(const wchar_t* wstr, size_t length,
1219 Message* msg) {
1220 for (size_t i = 0; i != length;) { // NOLINT
1221 if (wstr[i] != L'\0') {
1222 *msg << WideStringToUtf8(wstr + i, static_cast<int>(length - i));
1223 while (i != length && wstr[i] != L'\0') i++;
1224 } else {
1225 *msg << '\0';
1226 i++;
1227 }
1228 }
1229}
1230
1231#endif // GTEST_HAS_STD_WSTRING
1232

Callers 1

gtest.ccFile · 0.85

Calls 1

WideStringToUtf8Function · 0.85

Tested by

no test coverage detected