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

Byte-range request for Store::read_range. More...

#include <store.hpp>

Public Types

enum class  Kind : std::uint8_t { full , slice , suffix }
 Which part of the value to read. More...
 

Static Public Member Functions

static constexpr ByteRange full ()
 The whole value.
 
static constexpr ByteRange slice (std::uint64_t offset, std::uint64_t length)
 
static constexpr ByteRange suffix (std::uint64_t length)
 

Public Attributes

Kind kind = Kind::full
 Which part of the value to read.
 
std::uint64_t offset = 0
 Start of the range; used by Kind::slice only.
 
std::uint64_t length = 0
 Number of bytes; used by Kind::slice and Kind::suffix.
 

Detailed Description

Byte-range request for Store::read_range.

Member Enumeration Documentation

◆ Kind

enum class zarr::ByteRange::Kind : std::uint8_t
strong

Which part of the value to read.

Enumerator
full 

the whole value

slice 

length bytes starting at offset

suffix 

the final length bytes

Member Function Documentation

◆ slice()

static constexpr ByteRange zarr::ByteRange::slice ( std::uint64_t  offset,
std::uint64_t  length 
)
inlinestaticconstexpr

length bytes starting at byte offset. A range that lies outside the value is an error, not a truncation.

◆ suffix()

static constexpr ByteRange zarr::ByteRange::suffix ( std::uint64_t  length)
inlinestaticconstexpr

The final length bytes — fetches a trailing shard index in one round trip without knowing the value size. length greater than the value size is an error.


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