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

◆ lookup_registry()

fl::url fl::asset_detail::lookup_registry ( fl::string_view path)
inline

Look up an asset path in the registry. Returns invalid url() on miss.

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

50 {
51 auto& r = registry();
52 for (fl::size i = 0; i < r.size(); ++i) {
53 // Compare as string_view on both sides to avoid any ambiguity in the
54 // fl::string / fl::string_view overload resolution.
55 fl::string_view candidate(r[i].path.c_str(), r[i].path.size());
56 if (candidate == path) {
57 return r[i].url;
58 }
59 }
60 return fl::url();
61}
constexpr fl::size size() const FL_NOEXCEPT
Definition string_view.h:99
Definition url.h:15
fl::vector< AssetEntry > & registry() FL_NOEXCEPT
Definition asset.cpp.hpp:42

References FL_NOEXCEPT, and registry().

Referenced by fl::resolve_asset().

+ Here is the call graph for this function:
+ Here is the caller graph for this function: