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

◆ write()

bool MayaFlux::IO::CompositeWriter::write ( const std::string &  filepath,
const Kakshya::CompositeArray &  array 
)

Write a complete array in one call.

Opens with the array's layout, writes all its elements, then closes the file. A failed write still closes the file before returning, and a partial file may remain.

Parameters
filepathOutput path.
arraySource array.
Returns
True only when open, write, and close all succeed.

Definition at line 5 of file CompositeWriter.cpp.

8{
9 if (!open(filepath, array.layout()))
10 return false;
11
12 const auto rows = array.slice(0, array.size());
13 const bool accepted = rows && write_rows(*rows);
14 const bool finalized = close();
15
16 return accepted && finalized;
17}
uint32_t rows
bool accepted
Definition Scheduler.cpp:30
virtual bool open(const std::string &filepath, const Kakshya::CompositeLayout &layout)=0
Open a new file with the schema all subsequent slices must use.
virtual bool close()=0
Finish the file and release its output stream.
virtual bool write_rows(const Kakshya::CompositeSlice &rows)=0
Write a bounded slice of elements.

References accepted, close(), MayaFlux::Kakshya::CompositeArray::layout(), open(), rows, MayaFlux::Kakshya::CompositeArray::size(), MayaFlux::Kakshya::CompositeArray::slice(), and write_rows().

+ Here is the call graph for this function: