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

◆ asset()

asset_ref fl::asset ( const char * path)
constexpr

Construct an asset handle from a relative sketch path at runtime.

For compile-time rejection of .. paths, use the FL_ASSET() macro instead — it wraps this function with FL_STATIC_ASSERT.

This overload accepts any const char* (including runtime-computed pointers) and, for safety, returns an empty handle if the path contains a .. segment. Runtime resolution also refuses to walk past data/, so this is defense-in-depth rather than the primary gate.

Definition at line 128 of file asset.h.

128 {
130 ? asset_ref()
131 : asset_ref(path, asset_detail::clen(path));
132}
Opaque handle to a sketch-local asset.
Definition asset.h:84
constexpr bool path_has_parent_segment(const char *p) FL_NOEXCEPT
Compile-time check: returns true if the string contains a ".." segment.
Definition asset.h:73

References fl::asset_detail::clen(), FL_NOEXCEPT, and fl::asset_detail::path_has_parent_segment().

Referenced by fl::UIAudio::UIAudio().

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