Donner 0.5.1
Embeddable browser-grade SVG2 engine
Loading...
Searching...
No Matches
donner::editor::sandbox::FrameInspector Class Reference

All static helpers — inspector instances are stateless beyond the inputs each call is given. More...

#include "donner/editor/sandbox/FrameInspector.h"

Static Public Member Functions

static InspectionResult Decode (std::span< const uint8_t > wire)
 Parses wire into a command list without invoking any renderer. Always produces a result (even on partial parses); callers inspect InspectionResult::streamValid to distinguish "fully decoded" from "stopped at an error".
static ReplayStatus ReplayPrefix (std::span< const uint8_t > wire, std::size_t commandCount, svg::RendererInterface &target)
 Replays exactly the first commandCount commands into target. The counting starts at the kBeginFrame message — the kStreamHeader is always consumed but not counted as a "command". After the prefix is dispatched, target.endFrame() is synthesized if the prefix didn't already include a real kEndFrame, so the target has a valid frame to snapshot.
static std::string Dump (std::span< const uint8_t > wire)
 Builds a single-line textual summary of the wire stream: one row per command, with indentation tracking nesting depth. Intended for sandbox_inspect output and crash-report attachments.
static std::string_view OpcodeName (Opcode op)
 Returns a short, human-readable name for an opcode (e.g. "drawRect", "pushTransform"). Stable — safe to embed in logs and bug reports.
static std::string_view UnsupportedKindName (UnsupportedKind kind)
 Returns a short, human-readable name for an unsupported-kind tag.

Detailed Description

All static helpers — inspector instances are stateless beyond the inputs each call is given.

Member Function Documentation

◆ ReplayPrefix()

ReplayStatus donner::editor::sandbox::FrameInspector::ReplayPrefix ( std::span< const uint8_t > wire,
std::size_t commandCount,
svg::RendererInterface & target )
static

Replays exactly the first commandCount commands into target. The counting starts at the kBeginFrame message — the kStreamHeader is always consumed but not counted as a "command". After the prefix is dispatched, target.endFrame() is synthesized if the prefix didn't already include a real kEndFrame, so the target has a valid frame to snapshot.

Passing commandCount = SIZE_MAX replays the entire stream verbatim. commandCount = 0 begins a frame and immediately ends it — useful as a "clear to the start of the frame" baseline in the UI.

Returns
ReplayStatus::kOk on success, kMalformed if the stream is corrupt, kHeaderMismatch on a missing/wrong header.

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