MayaFlux 0.5.0
Digital-First Multimedia Processing Framework
Loading...
Searching...
No Matches

◆ get_attribute()

template<typename T >
std::optional< T > MayaFlux::IO::FileMetadata::get_attribute ( const std::string &  key) const
inline

Get a typed attribute value by key.

Template Parameters
TExpected type.
Parameters
keyAttribute key.
Returns
Optional value if present and convertible.

Definition at line 39 of file FileReader.hpp.

40 {
41 auto it = attributes.find(key);
42 if (it != attributes.end()) {
43 try {
44 return safe_any_cast<T>(it->second);
45 } catch (const std::bad_any_cast&) {
46 return std::nullopt;
47 }
48 }
49 return std::nullopt;
50 }
std::unordered_map< std::string, std::any > attributes
Type-specific metadata stored as key-value pairs (e.g., sample rate, channels)

References attributes.