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

195 {
196 const auto& opt = obj.*prop.member;
197 if (opt.has_value()) {
198 j[prop.key] = to_json(*opt);
199 }
200 }
static nlohmann::json to_json(const T &val)

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