libzarr
Header-only C++17 Zarr v2/v3, WASM-compatible
Loading...
Searching...
No Matches
Public Member Functions | Public Attributes | List of all members
zarr::ArrayMeta Struct Reference

#include <metadata.hpp>

Public Member Functions

std::uint64_t element_count () const
 Number of elements in the whole array (1 for rank 0).
 
std::uint64_t chunk_element_count () const
 Number of elements in one (full) chunk (1 for rank 0).
 
std::vector< std::uint64_t > grid_shape () const
 Chunk-grid extent per dimension.
 

Public Attributes

ZarrFormat format = ZarrFormat::v2
 Format this array was read from / will be written as.
 
std::vector< std::uint64_t > shape
 Array shape; empty = 0-dimensional.
 
std::vector< std::uint64_t > chunk_shape
 Chunk shape, same rank as shape; chunks may exceed the array extent.
 
DataType dtype
 Element type.
 
std::optional< Bytesfill
 
ChunkKeyKind key_encoding = ChunkKeyKind::v2
 Chunk-key scheme (see ChunkKeyKind).
 
char dimension_separator = '.'
 Chunk-key separator ('.' or '/').
 
json dimension_names
 v3 dimension_names member, preserved verbatim (null when absent).
 
std::vector< CodecSpeccodecs
 
std::vector< ShardLevelshard_levels
 Sharding levels (empty = unsharded); see ShardLevel.
 
json attributes = json::object()
 User attributes (v2 .zattrs / v3 attributes).
 

Detailed Description

Normalized array metadata, shared by every format version. Version quirks are resolved at parse time; everything downstream (codecs, chunk I/O) consumes only this.

Member Data Documentation

◆ codecs

std::vector<CodecSpec> zarr::ArrayMeta::codecs

Codec chain of the (innermost) chunks, in v3 order: array->array*, one array->bytes ("bytes"), then bytes->bytes*. sharding_indexed never appears here — it is lowered into shard_levels.

◆ fill

std::optional<Bytes> zarr::ArrayMeta::fill

Fill value as one element in native byte order; std::nullopt when the source metadata had fill_value:null (legal in v2), which reads as zeros.


The documentation for this struct was generated from the following file: