FastLED 3.10.6
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 130 of file asset.h.

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

References fl::asset_detail::clen(), FL_NO_EXCEPT, 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: