Skip to content

Engine → Scripting → script_fields.h

field_blob_reader

Syntax

class CONJURE_API field_blob_reader

Constructors

AccessSignatureDescription
publicexplicit field_blob_reader( std::span<const u8> blob) noexcept;Validates the header; a blob of 0 bytes is treated as an empty, valid blob.

Important

Copy constructor and assignment has been deleted.

Destructors

AccessSignatureDescription
public~field_blob_reader();

Variables

AccessNameTypeDefaultDescription
privatemBlobstd::span<const u8>{}
privatemCursorusize0
privatemFieldCountu320
privatemFieldsReadu320
privatemValidboolfalse

Functions

Public

field_count

[[nodiscard]] u32 field_count() const noexcept;

Fields the header announces.

is_valid

[[nodiscard]] bool is_valid() const noexcept;

False when the header is bad (magic, version, truncated).

next

[[nodiscard]] core::result<bool> next(
    field_blob_field &out);

Reads the next field. Returns false at the end, or FIELD_BLOB_INVALID when the field header or payload runs past the blob.

validate

[[nodiscard]] static core::result<void> validate(
    std::span<const u8> blob);

Reads the whole blob and fails on the first malformed field.