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

◆ encode_property() [1/2]

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

Definition at line 187 of file JSONSerializer.hpp.

191 {
192 const auto& opt = obj.*prop.member;
193 if (opt.has_value()) {
194 j[prop.key] = to_json(*opt);
195 }
196 }
static nlohmann::json to_json(const T &val)

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