14#include <unordered_map>
25 std::int64_t
readInt(std::span<const std::byte> image, std::size_t& pos, std::size_t bytes,
bool isSigned);
35 std::unordered_map<std::string, std::uint32_t>
lookup;
42 std::uint32_t
resolve(std::string_view value,
const std::vector<std::uint32_t>& journal, std::size_t& cursor);
49 std::span<const std::byte> image,
The owning byte buffer file contents are read into.
The decode target: the codecs build the record vector through this, one field at a time.
The encode source: the codecs read the record vector through this.
The type-erased boundary between the templated Table<Record> facade (table.hpp) and the per-format co...
std::int64_t readInt(std::span< const std::byte > image, std::size_t &pos, std::size_t bytes, bool isSigned)
Read a little-endian integer of bytes bytes at pos, sign-extended when isSigned, advancing pos.
void decodeInlineRecord(std::span< const Column > schema, std::size_t record, std::span< const std::byte > image, RecordSink &sink, TableState &state)
Decode one fixed-stride record's inline fields into sink and journal its string offsets (record then ...
void encodeInlineRecord(std::span< const Column > schema, const RecordSource &source, std::size_t record, FileBuffer &out, StringPool &pool, const TableState &state, std::size_t &cursor)
Encode one fixed-stride record's inline fields from source, appending to out and resolving strings th...
void writeInt(FileBuffer &out, std::int64_t value, std::size_t bytes)
Append value's low bytes bytes (little-endian) to out.
std::vector< std::byte > FileBuffer
Owning byte buffer for file contents read out of a client storage.
Schema reflection over generated client-database record structs: the column list, record stride and f...
StringBlock — the decoded representation of a chunk of zero-terminated strings (MOTX,...
The preserved decode state a table carries between read() and write() so a WDBC/WDB2 write is byte-pe...
A writable string block resolving values to byte-perfect offsets: the journaled original offset while...
StringPool(const formats::StringBlock &source)
Copy source (leading with the mandatory zero byte) and index it.
formats::StringBlock block
std::unordered_map< std::string, std::uint32_t > lookup
std::uint32_t resolve(std::string_view value, const std::vector< std::uint32_t > &journal, std::size_t &cursor)
The offset to store for value: journal[cursor] when it still holds value, else a deduped/appended off...