@@ -39,6 +39,10 @@ RecordBatchStreamReader::RecordBatchStreamReader(
39
39
}
40
40
41
41
libmexclass::proxy::MakeResult RecordBatchStreamReader::fromFile (const libmexclass::proxy::FunctionArguments& constructor_arguments) {
42
+ namespace mda = ::matlab::data;
43
+ using RecordBatchStreamReaderProxy =
44
+ arrow::matlab::io::ipc::proxy::RecordBatchStreamReader;
45
+
42
46
const mda::StructArray opts = constructor_arguments[0 ];
43
47
const mda::StringArray filename_mda = opts[0 ][" Filename" ];
44
48
const auto filename_utf16 = std::u16string (filename_mda[0 ]);
@@ -57,10 +61,14 @@ libmexclass::proxy::MakeResult RecordBatchStreamReader::fromFile(const libmexcla
57
61
}
58
62
59
63
libmexclass::proxy::MakeResult RecordBatchStreamReader::fromBytes (const libmexclass::proxy::FunctionArguments& constructor_arguments) {
64
+ namespace mda = ::matlab::data;
65
+ using RecordBatchStreamReaderProxy =
66
+ arrow::matlab::io::ipc::proxy::RecordBatchStreamReader;
67
+
60
68
const mda::StructArray opts = constructor_arguments[0 ];
61
69
const ::matlab::data::TypedArray<uint8_t > bytes_mda = opts[0 ][" Bytes" ];
62
- const auto matlab_buffer = std::make_shared<matlab::arrow ::MatlabBuffer>(bytes_mda);
63
- auto buffer_reader = std::make_shared<arrow::io::memory:: BufferReader>(matlab_buffer);
70
+ const auto matlab_buffer = std::make_shared<arrow:: matlab::buffer ::MatlabBuffer>(bytes_mda);
71
+ auto buffer_reader = std::make_shared<arrow::io::BufferReader>(matlab_buffer);
64
72
MATLAB_ASSIGN_OR_ERROR (auto reader,
65
73
arrow::ipc::RecordBatchStreamReader::Open (buffer_reader),
66
74
error::IPC_RECORD_BATCH_READER_OPEN_FAILED);
@@ -69,19 +77,16 @@ libmexclass::proxy::MakeResult RecordBatchStreamReader::fromBytes(const libmexcl
69
77
70
78
libmexclass::proxy::MakeResult RecordBatchStreamReader::make (
71
79
const libmexclass::proxy::FunctionArguments& constructor_arguments) {
72
- namespace mda = ::matlab::data;
73
- using RecordBatchStreamReaderProxy =
74
- arrow::matlab::io::ipc::proxy::RecordBatchStreamReader;
75
-
80
+ namespace mda = ::matlab::data;
76
81
const mda::StructArray opts = constructor_arguments[0 ];
77
82
78
83
// Dispatch to the appropriate static "make" method depending
79
84
// on the input type.
80
85
const mda::StringArray type_mda = opts[0 ][" Type" ];
81
86
const auto type_utf16 = std::u16string (type_mda[0 ]);
82
- if (type_utf16. equals ( u" Bytes" ) ) {
87
+ if (type_utf16 == u" Bytes" ) {
83
88
return RecordBatchStreamReader::fromBytes (constructor_arguments);
84
- } else if (type_utf16. equals ( u" Filename" ) ) {
89
+ } else if (type_utf16 == u" Filename" ) {
85
90
return RecordBatchStreamReader::fromFile (constructor_arguments);
86
91
} else {
87
92
// TODO: Create static error id string
0 commit comments