MayaFlux 0.1.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 40 of file FileReader.hpp.

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

References attributes.