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

Function ConvertToWString

cpp/src/arrow/flight/sql/odbc/tests/odbc_test_suite.cc:573–591  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

571}
572
573std::wstring ConvertToWString(const SQLWCHAR* str_val, SQLSMALLINT str_len,
574 SQLSMALLINT buffer_size) {
575 if (str_len == -1) {
576#ifdef __linux__
577 str_len = SqlWCharArrLen(str_val);
578#else // Windows & Mac
579 str_len = std::wcslen(str_val);
580#endif
581 }
582 std::wstring attr_str;
583 if (str_len == 0) {
584 attr_str = L"";
585 } else {
586 assert(str_val != nullptr);
587 assert(str_len > 0 && str_len <= buffer_size);
588 attr_str.assign(str_val, str_val + str_len);
589 }
590 return attr_str;
591}
592
593std::wstring ConvertToWString(const std::vector<SQLWCHAR>& str_val, SQLSMALLINT str_len,
594 SQLSMALLINT buffer_size) {

Callers 6

GetSQLColAttributeStringFunction · 0.85
TEST_FFunction · 0.85
TYPED_TESTFunction · 0.85
TYPED_TESTFunction · 0.85
TEST_FFunction · 0.85

Calls 4

SqlWCharArrLenFunction · 0.85
GetSqlWCharSizeFunction · 0.85
assignMethod · 0.80
beginMethod · 0.45

Tested by

no test coverage detected