API Reference

Hierarchy

Defined in xtensor-zarr/xzarr_hierarchy.hpp

template<class store_type>
class xzarr_hierarchy

Zarr hierarchy handler.

The xzarr_hierarchy class implements a handler for creating and accessing a hierarchy, an array or a group, as well as exploring the hierarchy.

See

zarray, xzarr_group, xzarr_node

tparam store_type

The type of the store (e.g. xzarr_file_system_store)

Warning

doxygenfunction: Unable to resolve function “xt::create_zarr_hierarchy” with arguments None in doxygen xml output for project “xtensor-zarr” from directory: ../xml. Potential matches:

- template<class store_type> xzarr_hierarchy<store_type> create_zarr_hierarchy(store_type &store, const std::string &zarr_version = "3")
- xzarr_hierarchy<xzarr_file_system_store> create_zarr_hierarchy(const char *local_store_path, const std::string &zarr_version = "3")
- xzarr_hierarchy<xzarr_file_system_store> create_zarr_hierarchy(const std::string &local_store_path, const std::string &zarr_version = "3")

Warning

doxygenfunction: Unable to resolve function “xt::get_zarr_hierarchy” with arguments None in doxygen xml output for project “xtensor-zarr” from directory: ../xml. Potential matches:

- template<class store_type> xzarr_hierarchy<store_type> get_zarr_hierarchy(store_type &store, const std::string &zarr_version = "")
- xzarr_hierarchy<xzarr_file_system_store> get_zarr_hierarchy(const char *local_store_path, const std::string &zarr_version = "")
- xzarr_hierarchy<xzarr_file_system_store> get_zarr_hierarchy(const std::string &local_store_path, const std::string &zarr_version = "")

Store

Defined in xtensor-zarr/xzarr_file_system_store.hpp

class xt::xzarr_file_system_store

Zarr store handler for a local file system.

The xzarr_file_system_store class implements a handler to a Zarr store, and supports the read, write and list operations.

See

xzarr_hierarchy

Public Functions

inline void list_dir(const std::string &prefix, std::vector<std::string> &keys, std::vector<std::string> &prefixes)

Retrieve all keys and prefixes with a given prefix and which do not contain the character “/” after the given prefix.

Parameters
  • prefix – the prefix

  • keys – set of keys to be returned by reference

  • prefixes – set of prefixes to be returned by reference

inline std::vector<std::string> list()

Retrieve all keys from the store.

Returns

returns a set of keys.

inline std::vector<std::string> list_prefix(const std::string &prefix)

Retrieve all keys with a given prefix from the store.

Parameters

prefix – the prefix

Returns

returns a set of keys with a given prefix.

inline void erase(const std::string &key)

Erase the given (key, value) pair from the store.

Parameters

key – the key

inline void erase_prefix(const std::string &prefix)

Erase all the keys with the given prefix from the store.

Parameters

prefix – the prefix

inline void set(const std::string &key, const std::string &value)

Store a (key, value) pair.

Parameters
  • key – the key

  • value – the value

inline std::string get(const std::string &key)

Retrieve the value associated with a given key.

Parameters

key – the key to get the value from

Returns

returns the value for the given key.