FSStore

Header file: <libs/zarr/fsstore.hpp> [source]

class FSStore

A file system store e.g. for Zarr arrays or groups.

This class represents a file system store for a series of key-value pairs for example for storing Zarr data arrays or groups. Data for a given key is written to the store via helper functions from the StoreAccessor struct.

Public Functions

inline explicit FSStore(const std::filesystem::path basedir)

Constructs an FSStore object with the specified base directory.

Parameters:

basedir – The root directory of the file system store.

inline StoreAccessor<FSStore> operator[](const std::string_view key)

Operator to use a StoreAccessor to write values under a given key.

Usage: operator[y] = x; writes values x under a key called ‘y’ using the StoreAccessor.

Parameters:

key – The key for which the StoreAccessor is accessed.

Returns:

A StoreAccessor object associated with the specified key.

bool write(const std::string_view key, const std::span<const uint8_t> buffer) const

Write function called by StoreAccessor to write data to file system storage after the data has been converted into a vector of unsigned integer types.

This function can be used by a StoreAccessor object to write data represented as a vector of unsigned integer types to the file system store under the specified key.

Parameters:
  • key – The key under which the data will be stored in the file system store.

  • buffer – A span representing the range of memory containing the unsigned bytes to be written.

Returns:

True if the write operation is successful, false otherwise.

Private Members

const std::filesystem::path basedir

The root directory of the file system store.