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

Internals of the round-trip audit (namespace wowlib::audit::detail): the per-format driver class — one static member per format, each defined in its own translation unit so the version matrices compile in parallel — plus the small shared primitives (outcome construction, byte-divergence description, unknown-chunk tallying, and the runtime-to-compile-time version dispatch). More...

#include <algorithm>
#include <cstddef>
#include <cstdint>
#include <cstring>
#include <exception>
#include <format>
#include <optional>
#include <span>
#include <string>
#include <utility>
#include <wowlib/audit/roundtrip.hpp>
#include <wowlib/core/buffer.hpp>
#include <wowlib/core/client_version.hpp>
#include <wowlib/formats/common/chunked_file.hpp>
#include <wowlib/formats/common/fourcc.hpp>
#include <wowlib/fs/filesystem.hpp>
Include dependency graph for detail.hpp:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

class  wowlib::audit::detail::FormatDrivers
 The per-format round-trip drivers behind Auditor::roundtrip. More...

Namespaces

namespace  wowlib
namespace  wowlib::audit
namespace  wowlib::audit::detail

Functions

RoundtripReport wowlib::audit::detail::failed (std::string stage, std::string error)
 A failed outcome.
RoundtripReport wowlib::audit::detail::skipped (std::string_view reason)
 A skipped outcome — ok, tagged with the reason.
RoundtripReport wowlib::audit::detail::failWith (RoundtripReport &report, std::string stage, std::string error)
 Mark report failed in place and hand it back — keeps the unknown-chunk tally gathered before the failure.
std::optional< RoundtripReport > wowlib::audit::detail::classifyRead (RoundtripReport &report, std::string stage, const Result< FileBuffer > &result)
 Classify a client-file read for the audit: content behind an unknown TACT key and zero-byte archive entries (classic-era clients ship thousands of empty placeholder files) cannot be round-tripped and are skips, not failures; other errors fail at stage.
void wowlib::audit::detail::tallyUnknown (RoundtripReport &report, const formats::ChunkExtras &extras, formats::FourCCEndian endian=formats::FourCCEndian::Reversed)
 Append every unmodeled chunk of a parsed entity to the report's tally, one fourcc spelling per occurrence.
template<typename F>
RoundtripReport wowlib::audit::detail::guarded (F &&f)
 Run one file's driver, converting any escaping exception into a failed outcome — one pathological file must not kill an hours-long sweep.
std::optional< std::string > wowlib::audit::detail::firstDivergence (const FileBuffer &original, const FileBuffer &rewritten)
 The first byte divergence between an original and a rewrite, described by offset and sizes — the stability compare's diagnostic for offset formats (no chunk framing to locate the divergence in).
std::optional< std::string > wowlib::audit::detail::firstDivergenceChunked (const FileBuffer &original, const FileBuffer &rewritten)
 The first byte divergence between an original chunk stream and its rewrite, located within the enclosing chunk — the byte-perfect guarantee's debugging lens (ported from the round-trip tests' requireIdentical).
template<typename F>
bool wowlib::audit::detail::withVersion (const ClientVersion v, F &&f)
 Invoke f with the targeted release constant matching v as a compile-time template argument — the runtime-to-compile-time bridge of the version dispatch.
constexpr bool wowlib::audit::detail::versionSupported (std::span< const ClientVersion > grid, const ClientVersion v)
 Whether a format's instantiation grid carries v — the per-format if constexpr guard of the version dispatch.
RoundtripReport wowlib::audit::detail::unrecognizedVersion (const ClientVersion v)
 The dispatch-failure outcome for a version outside the targeted releases.

Detailed Description

Internals of the round-trip audit (namespace wowlib::audit::detail): the per-format driver class — one static member per format, each defined in its own translation unit so the version matrices compile in parallel — plus the small shared primitives (outcome construction, byte-divergence description, unknown-chunk tallying, and the runtime-to-compile-time version dispatch).

Nothing here is welded; plain Doxygen throughout.

Definition in file detail.hpp.