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

◆ decode_property() [1/2]

template<typename Class , typename T >
static void MayaFlux::IO::JSONSerializer::decode_property ( const nlohmann::json &  j,
Class &  obj,
const OptionalProperty< Class, T > &  prop 
)
inlinestaticprivate

Definition at line 289 of file JSONSerializer.hpp.

293 {
294 if (!j.contains(prop.key) || j.at(prop.key).is_null()) {
295 obj.*prop.member = std::nullopt;
296 } else {
297 T inner {};
298 from_json(j.at(prop.key), inner);
299 obj.*prop.member = std::move(inner);
300 }
301 }
static void from_json(const nlohmann::json &j, T &out)

References MayaFlux::IO::OptionalProperty< Class, T >::key, MayaFlux::IO::OptionalProperty< Class, T >::member, and MayaFlux::IO::T.