Cross-platform asset file loading utility. More...
#include <asset_loader.h>
Static Public Member Functions | |
static absl::StatusOr< std::string > | LoadTextFile (const std::string &relative_path) |
static absl::StatusOr< std::filesystem::path > | FindAssetFile (const std::string &relative_path) |
static std::vector< std::filesystem::path > | GetSearchPaths (const std::string &relative_path) |
static bool | AssetExists (const std::string &relative_path) |
Cross-platform asset file loading utility.
Handles platform-specific paths for loading assets from:
Definition at line 23 of file asset_loader.h.
|
static |
Load a text file from the assets directory
relative_path | Path relative to assets/ (e.g., "agent/system_prompt.txt") |
Definition at line 64 of file asset_loader.cc.
References FindAssetFile().
Referenced by yaze::editor::AgentEditor::DrawCommonTilesEditor(), yaze::editor::AgentEditor::DrawNewPromptCreator(), and yaze::editor::AgentEditor::DrawPromptEditorPanel().
|
static |
Find an asset file by trying multiple platform-specific paths
relative_path | Path relative to assets/ |
Definition at line 44 of file asset_loader.cc.
References GetSearchPaths().
Referenced by AssetExists(), and LoadTextFile().
|
static |
Get list of search paths for a given asset
relative_path | Path relative to assets/ |
Definition at line 12 of file asset_loader.cc.
References yaze::util::GetBundleResourcePath().
Referenced by FindAssetFile().
|
static |
Check if an asset file exists
relative_path | Path relative to assets/ |
Definition at line 89 of file asset_loader.cc.
References FindAssetFile().