MayaFlux 1.0.0
Digital-First Multimedia Processing Framework
Loading...
Searching...
No Matches

◆ write_rows()

bool MayaFlux::IO::DelimitedTextWriter::write_rows ( const Kakshya::CompositeSlice &  rows)
overridevirtual

Encode a bounded slice using the open file's layout.

Parameters
rowsElements to append; field names, types, and order must match the layout passed to open().
Returns
True when every element was accepted. On failure, elements before the failing one have already been written.

Implements MayaFlux::IO::CompositeWriter.

Definition at line 257 of file DelimitedTextWriter.cpp.

259{
260 if (!is_open() || !m_layout) {
261 m_last_error = "No delimited text output is open";
262 return false;
263 }
264
265 if (!same_layout(*m_layout, rows.layout())) {
266 m_last_error = "Composite slice layout differs from the open file";
267 return false;
268 }
269
270 for (size_t i = 0; i < rows.size(); ++i) {
271 const auto element = rows.at(i);
272
273 if (!element || !write_element(*element))
274 return false;
275
277 }
278
279 return true;
280}
uint32_t rows
bool write_element(const Kakshya::Composite &element)
bool is_open() const override
Whether an output file is open.
std::optional< Kakshya::CompositeLayout > m_layout

References is_open(), m_last_error, m_layout, m_rows_written, rows, and write_element().

+ Here is the call graph for this function: