Struct Reader
Defined in File manifest-loader.h
Struct Documentation
-
struct Reader
Parse version 2.0 sprite/tileset manifests into backend-independent definitions.
Texture paths resolve from the enclosing graphics directory. Duplicate IDs across documents and image bounds are checked by Loader after it has collected the full asset set.
Public Static Functions
-
static Graphics load(const std::filesystem::path &file)
Declaration:
[[nodiscard]]Open and parse one graphics schema/version 2.0 document on the CPU.
See also
- Parameters:
file – Manifest origin used to resolve graphics-root-relative texture references.
- Returns:
Owned definitions; no discovery/cache/native state changes occur. Unreadable/malformed/unsupported data throws runtime_exception; full-batch duplicate identities and decoded image bounds remain Loader validation.
-
static Graphics parse(std::istream &input, const std::filesystem::path &source)
Declaration:
[[nodiscard]]Parse a graphics document from borrowed stream storage.
- Parameters:
input – Stream consumed during parsing; bytes are not retained.
source – Document origin for diagnostics and graphics-root-relative references.
- Returns:
Owned normalized definitions; parsing alone performs no resource upload or batch/cache validation. Malformed/schema/field errors throw runtime_exception; allocation/stream-related failures propagate.
-
static CE::Assets::Shaders::Manifest load_shader(const std::filesystem::path &file)
Declaration:
[[nodiscard]]Open and parse one shader/material recipe document without native construction.
See also
- Parameters:
file – Document origin for diagnostics/source-path resolution.
- Returns:
Owned recipes; Loader later snapshots selected source-file bytes. Unreadable/malformed/unsupported data rejects parsing; no shader is compiled or catalogue entry published.
-
static CE::Assets::Shaders::Manifest parse_shader(std::istream &input, const std::filesystem::path &source)
Declaration:
[[nodiscard]]Parse shader/material definitions from a borrowed stream.
- Parameters:
input – JSON stream consumed during this call.
source – Origin for diagnostics and source-root-relative path resolution.
- Returns:
Owned recipes, without native program/material resources. Syntax/schema/field failures reject; backend capability/reflection checks remain the provider builder’s responsibility.
-
static std::vector<Graphics> load_graphics(const CE::Assets::Loading::FileRegistry &files)
Declaration:
[[nodiscard]]Load all registered graphics indexes and return their selected graphics documents.
- Parameters:
files – Stable registered exact paths; unrelated JSON is not treated as a manifest.
- Returns:
Owned graphics definitions, deduplicated by referenced document across the batch. References are graphics-relative exact registered paths; unknown/malformed/index/schema data rejects. Shader definitions are not returned by this compatibility projection.
-
static Definitions load_graphics_definitions(const CE::Assets::Loading::FileRegistry &files, const std::vector<std::filesystem::path> &indexes = {})
Declaration:
[[nodiscard]]Resolve registered graphics-manifests.json selections and parse referenced graphics/shader documents once.
See also
- Parameters:
files – Full stable discovery registry, including selected indexes and their exact references.
indexes – Empty selects every registered index; explicit paths select a focused batch.
- Returns:
Owned selected definitions without image decoding, shader compilation or runtime publication. Unknown/nonindex selections, missing/unregistered references or malformed documents throw; allocation/I/O failures propagate.
-
static Graphics load(const std::filesystem::path &file)