|
libzarr
Header-only C++17 Zarr v2/v3, WASM-compatible
|
#include <cmath>#include <cstdint>#include <cstdlib>#include <cstring>#include <limits>#include <optional>#include <string>#include <vector>#include <nlohmann/json.hpp>#include "libzarr/detail/common.hpp"#include "libzarr/types.hpp"Go to the source code of this file.
Classes | |
| struct | zarr::CodecSpec |
| struct | zarr::ShardLevel |
| struct | zarr::ArrayMeta |
| struct | zarr::OpenOptions |
| Options for opening arrays and groups. More... | |
Namespaces | |
| namespace | zarr::codec |
Typedefs | |
| using | zarr::json = nlohmann::json |
Enumerations | |
| enum class | zarr::ChunkKeyKind : std::uint8_t { v2 , v3_default } |
Functions | |
| CodecSpec | zarr::codec::gzip (int level=5) |
gzip (RFC 1952) at level (0-9). | |
| CodecSpec | zarr::codec::zlib (int level=5) |
zlib (RFC 1950) at level (0-9). Zarr v2 only. | |
| CodecSpec | zarr::codec::blosc (const std::string &cname="lz4", int clevel=5, const std::string &shuffle="shuffle") |
| blosc (v3-style named shuffle: "noshuffle", "shuffle" or "bitshuffle"). | |
| CodecSpec | zarr::codec::zstd (int level=0, bool checksum=false) |
zstd. Level 0 means zstd's default; checksum appends a frame checksum. | |
| CodecSpec | zarr::codec::crc32c () |
| crc32c (Castagnoli) trailing checksum. v3 only. | |
| CodecSpec | zarr::codec::shuffle (int elementsize=0) |
shuffle: byte-transposition filter. elementsize 0 means the dtype size. | |
| Bytes | zarr::canonical_json_bytes (const json &j) |
The normalized, version-independent array metadata (ArrayMeta) plus codec descriptors and fill-value encoding. Version-specific parse/emit lives in v2.hpp / v3.hpp, which lower into these types.
| using zarr::json = typedef nlohmann::json |
JSON type used throughout libzarr (vendored nlohmann/json by default; see LIBZARR_EXTERNAL_JSON). Objects keep keys sorted, which makes every serialization deterministic.
|
strong |
Chunk-key scheme. v2: indices joined by a separator ('.' default), rank 0 is "0". v3 "default": "c" prefix + separator-joined indices ('/' default), rank 0 is "c". v3's "v2" encoding maps onto v2.
|
inline |
Serializes JSON in libzarr's canonical form: 4-space indent, sorted keys (nlohmann's storage order), UTF-8. Byte-stable across platforms.