MayaFlux 0.1.0
Digital-First Multimedia Processing Framework
Loading...
Searching...
No Matches
MayaFlux::IO::FileReader Class Referenceabstract

Abstract interface for reading various file formats into containers. More...

#include <FileReader.hpp>

+ Inheritance diagram for MayaFlux::IO::FileReader:
+ Collaboration diagram for MayaFlux::IO::FileReader:

Public Member Functions

virtual ~FileReader ()=default
 
virtual bool can_read (const std::string &filepath) const =0
 Check if a file can be read by this reader.
 
virtual bool open (const std::string &filepath, FileReadOptions options=FileReadOptions::ALL)=0
 Open a file for reading.
 
virtual void close ()=0
 Close the currently open file.
 
virtual bool is_open () const =0
 Check if a file is currently open.
 
virtual std::optional< FileMetadataget_metadata () const =0
 Get metadata from the open file.
 
virtual std::vector< FileRegionget_regions () const =0
 Get semantic regions from the file.
 
virtual std::vector< Kakshya::DataVariantread_all ()=0
 Read all data from the file into memory.
 
virtual std::vector< Kakshya::DataVariantread_region (const FileRegion &region)=0
 Read a specific region of data.
 
virtual std::shared_ptr< Kakshya::SignalSourceContainercreate_container ()=0
 Create and initialize a container from the file.
 
virtual bool load_into_container (std::shared_ptr< Kakshya::SignalSourceContainer > container)=0
 Load file data into an existing container.
 
virtual std::vector< uint64_t > get_read_position () const =0
 Get current read position in primary dimension.
 
virtual bool seek (const std::vector< uint64_t > &position)=0
 Seek to a specific position in the file.
 
virtual std::vector< std::string > get_supported_extensions () const =0
 Get supported file extensions for this reader.
 
virtual std::type_index get_data_type () const =0
 Get the data type this reader produces.
 
virtual std::type_index get_container_type () const =0
 Get the container type this reader creates.
 
virtual std::string get_last_error () const =0
 Get the last error message.
 
virtual bool supports_streaming () const =0
 Check if streaming is supported for the current file.
 
virtual uint64_t get_preferred_chunk_size () const =0
 Get the preferred chunk size for streaming.
 
virtual size_t get_num_dimensions () const =0
 Get the dimensionality of the file data.
 
virtual std::vector< uint64_t > get_dimension_sizes () const =0
 Get size of each dimension in the file data.
 

Static Protected Member Functions

static std::unordered_map< std::string, Kakshya::RegionGroupregions_to_groups (const std::vector< FileRegion > &regions)
 Convert file regions to region groups.
 

Detailed Description

Abstract interface for reading various file formats into containers.

FileReader provides a type-agnostic interface for loading file data into the MayaFlux container system. It supports a wide range of structured data:

  • Audio files (WAV, MP3, FLAC, etc.)
  • Video files (MP4, AVI, MOV, etc.)
  • Image sequences or multi-dimensional image data
  • Scientific data formats (HDF5, NetCDF, etc.)
  • Custom binary formats
  • Text-based structured data (JSON, XML, CSV as regions)

The interface is designed for flexibility, supporting region extraction, metadata parsing, streaming, and container creation for any data type.

Definition at line 120 of file FileReader.hpp.


The documentation for this class was generated from the following files: