|
spudplate
Template scaffolding compiler for spudlang .spud files
|
SourceProvider backed by a borrowed asset map.
More...
#include <interpreter.h>
Public Member Functions | |
| AssetMapSourceProvider (const std::vector< SpudpackAsset > &assets) | |
| Construct over a borrowed asset vector; the caller owns the lifetime. | |
| std::pair< std::vector< std::uint8_t >, std::uint16_t > | read (std::string_view path) const override |
| Read the bytes of an asset by its normalised path. | |
| std::vector< Entry > | list_under (std::string_view prefix) const override |
| List every entry under the given prefix, including synthesised intermediate directories. | |
SourceProvider backed by a borrowed asset map.
Used by cmd_run when running an installed .spp. The provider holds a reference to the asset vector inside the decoded Spudpack; the caller must keep that pack alive for the duration of any call into the interpreter. cmd_run does so by scoping the Spudpack and the provider in the same lexical block.
|
overridevirtual |
Read the bytes of an asset by its normalised path.
Returns the content and the asset mode (or 0 when the provider does not carry mode information).
Implements spudplate::SourceProvider.
|
overridevirtual |
List every entry under the given prefix, including synthesised intermediate directories.
The returned list is in pre-order (parent before children) so callers that map entries to filesystem operations naturally satisfy the create-parent-first ordering.
Implements spudplate::SourceProvider.