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

Function lookup_registry

src/fl/asset/asset.cpp.hpp:50–61  ·  view source on GitHub ↗

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

Source from the content-addressed store, hash-verified

48
49/// Look up an asset path in the registry. Returns invalid url() on miss.
50inline fl::url lookup_registry(fl::string_view path) FL_NOEXCEPT {
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}
62
63#if defined(FASTLED_TESTING) || defined(FL_IS_STUB)
64/// Host/stub resolution: try the raw file on disk, then the sibling `.lnk`.

Callers 1

resolve_assetFunction · 0.85

Calls 3

urlClass · 0.85
sizeMethod · 0.45
c_strMethod · 0.45

Tested by

no test coverage detected