|
libzarr
Header-only C++17 Zarr v2/v3, WASM-compatible
|
Store mapping keys to files under a root directory. More...
#include <filesystem_store.hpp>
Public Member Functions | |
| FilesystemStore (std::filesystem::path root, bool create=true) | |
Binds to root, creating the directory when create is true. | |
| std::optional< Bytes > | read (std::string_view key) override |
Full value at key, or std::nullopt if the key is absent. | |
| std::optional< Bytes > | read_range (std::string_view key, ByteRange range) override |
| void | write (std::string_view key, Bytes value) override |
Create or replace the value at key. | |
| std::optional< std::uint64_t > | size (std::string_view key) override |
| bool | exists (std::string_view key) override |
True if key holds a value. | |
| void | erase (std::string_view key) override |
Remove key; removing an absent key is a no-op. | |
| std::vector< std::string > | list_prefix (std::string_view prefix) override |
All keys starting with prefix ("" or ending in '/'), sorted. | |
| DirListing | list_dir (std::string_view prefix) override |
Immediate children under prefix ("" or ending in '/'). | |
Public Member Functions inherited from zarr::Store | |
| Store (const Store &)=delete | |
| Store & | operator= (const Store &)=delete |
| Store (Store &&)=delete | |
| Store & | operator= (Store &&)=delete |
| virtual std::vector< std::optional< Bytes > > | read_many (const std::vector< ReadRequest > &requests) |
| virtual void | flush () |
Store mapping keys to files under a root directory.
|
inlineoverridevirtual |
Remove key; removing an absent key is a no-op.
Implements zarr::Store.
|
inlineoverridevirtual |
True if key holds a value.
Implements zarr::Store.
|
inlineoverridevirtual |
Immediate children under prefix ("" or ending in '/').
Implements zarr::Store.
|
inlineoverridevirtual |
All keys starting with prefix ("" or ending in '/'), sorted.
Implements zarr::Store.
|
inlineoverridevirtual |
Full value at key, or std::nullopt if the key is absent.
Implements zarr::Store.
|
inlineoverridevirtual |
Part of the value at key: std::nullopt if the key is absent, throws zarr::error if the range lies outside the value. The default implementation reads the full value and slices it; backends with native range reads (files, HTTP) should override.
Reimplemented from zarr::Store.
|
inlineoverridevirtual |
Size in bytes of the value at key, or std::nullopt if absent. The default implementation reads the whole value; backends with cheap stat (files: fstat, HTTP: HEAD) should override.
Reimplemented from zarr::Store.
|
inlineoverridevirtual |
Create or replace the value at key.
Implements zarr::Store.