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

◆ load_composite()

std::shared_ptr< Kakshya::CompositeContainer > MayaFlux::IO::IOManager::load_composite ( const std::string &  filepath,
std::optional< Kakshya::CompositeLayout >  layout = std::nullopt,
size_t  batch_size = 1 
)

Load a complete Composite file into an owning container.

Dispatches by supported file format. The reader is local to this call; use open_composite_reader() for bounded reading of large files.

Parameters
filepathPath to a supported Composite file.
layoutOptional exact field layout for typed CSV/TSV values.
batch_sizeDefault container materialization batch size.
Returns
Owning CompositeContainer, or nullptr on failure.

Definition at line 814 of file IOManager.cpp.

818{
819 auto reader = open_composite_reader(filepath, std::move(layout));
820 if (!reader)
821 return nullptr;
822
823 auto container = reader->create_composite_container(batch_size);
824 if (!container) {
826 "IOManager::load_composite: failed to read '{}' because {}",
827 filepath, reader->get_last_error());
828 return nullptr;
829 }
830
832 "IOManager::load_composite: loaded '{}'",
833 std::filesystem::path(filepath).filename().string());
834
835 return container;
836}
#define MF_INFO(comp, ctx,...)
#define MF_ERROR(comp, ctx,...)
std::shared_ptr< CompositeReader > open_composite_reader(const std::string &filepath, std::optional< Kakshya::CompositeLayout > layout=std::nullopt)
Open a schema-bearing reader selected by file format.
@ FileIO
Filesystem I/O operations.
@ API
MayaFlux/API Wrapper and convenience functions.

References MayaFlux::Journal::API, MayaFlux::Journal::FileIO, MF_ERROR, MF_INFO, and open_composite_reader().

+ Here is the call graph for this function: