MayaFlux 1.0.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 37 of file FileReader.hpp.

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

References attributes.