Look up an asset path in the registry. Returns invalid url() on miss.
| 48 | |
| 49 | /// Look up an asset path in the registry. Returns invalid url() on miss. |
| 50 | inline 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`. |
no test coverage detected