Engine → Scripting → script_fields.h
field_blob_reader¶
| Type | Class |
| Namespace | conjure::scripting |
| Include File Path | engine/include/conjure/scripting/script_fields.h |
| Source File Path | engine/src/scripting/script_fields.cpp |
| API ↗ | Scripting, Scripts, components and the runtime |
Syntax¶
Constructors¶
| Access | Signature | Description |
|---|---|---|
| public | explicit 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¶
| Access | Signature | Description |
|---|---|---|
| public | ~field_blob_reader(); |
Variables¶
| Access | Name | Type | Default | Description |
|---|---|---|---|---|
| private | mBlob | std::span<const u8> | {} | |
| private | mCursor | usize | 0 | |
| private | mFieldCount | u32 | 0 | |
| private | mFieldsRead | u32 | 0 | |
| private | mValid | bool | false |
Functions¶
Public¶
is_valid¶
is_valid¶[[nodiscard]] bool is_valid() const noexcept;False when the header is bad (magic, version, truncated).
next¶
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¶
validate¶[[nodiscard]] static core::result<void> validate(
std::span<const u8> blob);Reads the whole blob and fails on the first malformed field.