| 157 | } // anonymous namespace |
| 158 | |
| 159 | libmexclass::proxy::MakeResult Table::make( |
| 160 | const libmexclass::proxy::FunctionArguments& constructor_arguments) { |
| 161 | mda::StructArray opts = constructor_arguments[0]; |
| 162 | const mda::StringArray method = opts[0]["Method"]; |
| 163 | |
| 164 | if (method[0] == u"from_arrays") { |
| 165 | return from_arrays(opts); |
| 166 | } else if (method[0] == u"from_record_batches") { |
| 167 | return from_record_batches(opts); |
| 168 | } else { |
| 169 | const auto method_name_utf16 = std::u16string(method[0]); |
| 170 | MATLAB_ASSIGN_OR_ERROR(const auto method_name_utf8, |
| 171 | arrow::util::UTF16StringToUTF8(method_name_utf16), |
| 172 | error::UNICODE_CONVERSION_ERROR_ID); |
| 173 | const std::string error_msg = "Unknown make method: " + method_name_utf8; |
| 174 | return libmexclass::error::Error{error::TABLE_MAKE_UNKNOWN_METHOD, error_msg}; |
| 175 | } |
| 176 | } |
| 177 | |
| 178 | void Table::getNumRows(libmexclass::proxy::method::Context& context) { |
| 179 | namespace mda = ::matlab::data; |
nothing calls this directly
no test coverage detected