FastLED 3.9.15
Loading...
Searching...
No Matches

◆ register_asset()

void fl::register_asset ( fl::string_view path,
const fl::url & u )

Public helper: plug an asset mapping at runtime.

Register an asset path → URL mapping at runtime.

Used by:

  • Generated C++ from ci/compiler/asset_scanner.py.
  • Unit tests that want to simulate a manifest without fbuild.

Populates the same registry resolve_asset() consults. Called from:

  • Generated C++ emitted by the fbuild asset scanner (ci/compiler/asset_scanner.py) — populates the full sketch manifest.
  • Unit tests and host code that want to stand up a manifest without running fbuild.

Last writer wins for duplicate paths (scan then manually plug in tests).

Definition at line 118 of file asset.cpp.hpp.

118 {
119 asset_detail::registry().push_back(
120 {fl::string(path.data(), path.size()), u});
121}
constexpr fl::size size() const FL_NOEXCEPT
Definition string_view.h:99
constexpr const char * data() const FL_NOEXCEPT
Definition string_view.h:94
fl::vector< AssetEntry > & registry() FL_NOEXCEPT
Definition asset.cpp.hpp:42

References FL_NOEXCEPT, and fl::asset_detail::registry().

+ Here is the call graph for this function: