MCPcopy Create free account
hub / github.com/FastLED/FastLED / resolve_asset

Function resolve_asset

src/fl/asset/asset.cpp.hpp:123–144  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

121}
122
123fl::url resolve_asset(const asset_ref& a) FL_NOEXCEPT {
124 if (!a) {
125 return fl::url();
126 }
127 const fl::string_view p = a.path();
128
129 // 1. Registry always wins. On WASM this is populated by generated code
130 // from the asset scanner; on host/stub tests may populate it manually.
131 fl::url fromRegistry = asset_detail::lookup_registry(p);
132 if (fromRegistry.isValid()) {
133 return fromRegistry;
134 }
135
136 // 2. Host/stub: fall back to filesystem probe + sibling .lnk.
137#if defined(FASTLED_TESTING) || defined(FL_IS_STUB)
138 return asset_detail::resolve_host(p);
139#else
140 // 3. Other platforms (WASM without manifest, ESP32 v1): no fallback.
141 // TODO(#2284): ESP32 LittleFS / SD-card resolution.
142 return fl::url();
143#endif
144}
145
146} // namespace fl

Callers 2

UIAudioMethod · 0.85
FL_TEST_FILEFunction · 0.85

Calls 5

urlClass · 0.85
lookup_registryFunction · 0.85
resolve_hostFunction · 0.85
pathMethod · 0.45
isValidMethod · 0.45

Tested by

no test coverage detected