MCPcopy Create free account
hub / github.com/apache/arrow / WcsToUtf8

Function WcsToUtf8

cpp/src/arrow/flight/sql/odbc/odbc_impl/encoding.h:108–121  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

106
107template <typename CHAR_TYPE>
108inline void WcsToUtf8(const void* wcs_string, size_t length_in_code_units,
109 std::vector<uint8_t>* result) {
110 const auto* begin = static_cast<const CHAR_TYPE*>(wcs_string);
111
112 std::string string;
113 if constexpr (sizeof(CHAR_TYPE) == sizeof(char16_t)) {
114 ::utf8::utf16to8(begin, begin + length_in_code_units, std::back_inserter(string));
115 } else {
116 static_assert(sizeof(CHAR_TYPE) == sizeof(char32_t));
117 ::utf8::utf32to8(begin, begin + length_in_code_units, std::back_inserter(string));
118 }
119
120 result->assign(string.begin(), string.end());
121}
122
123inline void WcsToUtf8(const void* wcs_string, size_t length_in_code_units,
124 std::vector<uint8_t>* result) {

Callers 2

SetAttributeSQLWCHARFunction · 0.85
SqlWcharToStringFunction · 0.85

Calls 7

GetSqlWCharSizeFunction · 0.85
DriverExceptionClass · 0.85
to_stringFunction · 0.85
wcsstrlenFunction · 0.85
assignMethod · 0.80
beginMethod · 0.45
endMethod · 0.45

Tested by

no test coverage detected