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

Method getRowAsString

matlab/src/cpp/arrow/matlab/tabular/proxy/table.cc:292–309  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

290}
291
292void Table::getRowAsString(libmexclass::proxy::method::Context& context) {
293 namespace mda = ::matlab::data;
294 using namespace libmexclass::proxy;
295 mda::ArrayFactory factory;
296
297 mda::StructArray args = context.inputs[0];
298 const mda::TypedArray<int64_t> index_mda = args[0]["Index"];
299 const auto matlab_row_index = int64_t(index_mda[0]);
300
301 MATLAB_ASSIGN_OR_ERROR_WITH_CONTEXT(
302 auto row_str_utf8,
303 arrow::matlab::tabular::get_row_as_string(table, matlab_row_index), context,
304 error::TABULAR_GET_ROW_AS_STRING_FAILED);
305 MATLAB_ASSIGN_OR_ERROR_WITH_CONTEXT(auto row_str_utf16,
306 arrow::util::UTF8StringToUTF16(row_str_utf8),
307 context, error::UNICODE_CONVERSION_ERROR_ID);
308 context.outputs[0] = factory.createScalar(row_str_utf16);
309}
310
311} // namespace arrow::matlab::tabular::proxy

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected