wowlib 0.0.0
Read & write World of Warcraft client files — a C++26 core
Loading...
Searching...
No Matches
codec_detail.hpp File Reference

Shared codec internals for the fixed-stride formats (WDBC, WDB2): the string pool that reproduces byte-perfect offsets, and the per-record inline field decode/encode driven by the runtime schema. More...

#include <cstddef>
#include <cstdint>
#include <span>
#include <string>
#include <string_view>
#include <unordered_map>
#include <vector>
#include <wowlib/core/buffer.hpp>
#include <wowlib/db/codec.hpp>
#include <wowlib/db/schema.hpp>
#include <wowlib/formats/common/string_block.hpp>
Include dependency graph for codec_detail.hpp:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  wowlib::db::detail::StringPool
 A writable string block resolving values to byte-perfect offsets: the journaled original offset while the value still matches, else an equal existing entry, else a fresh append. More...

Namespaces

namespace  wowlib
namespace  wowlib::db
namespace  wowlib::db::detail

Functions

std::int64_t wowlib::db::detail::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 wowlib::db::detail::writeInt (FileBuffer &out, std::int64_t value, std::size_t bytes)
 Append value's low bytes bytes (little-endian) to out.
void wowlib::db::detail::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 schema then element order).
void wowlib::db::detail::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 through pool (cursor tracks the journal).

Detailed Description

Shared codec internals for the fixed-stride formats (WDBC, WDB2): the string pool that reproduces byte-perfect offsets, and the per-record inline field decode/encode driven by the runtime schema.

All non-templated — compiled once in codec_common.cpp.

Definition in file codec_detail.hpp.