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 268 of file JSONSerializer.hpp.

272 {
273 if (!j.contains(prop.key) || j.at(prop.key).is_null()) {
274 obj.*prop.member = std::nullopt;
275 } else {
276 T inner {};
277 from_json(j.at(prop.key), inner);
278 obj.*prop.member = std::move(inner);
279 }
280 }
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.