MCPcopy Create free account
hub / github.com/NVIDIAGameWorks/Falcor / valueToJson

Function valueToJson

Source/Falcor/Utils/Properties.cpp:51–73  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

49
50template<typename T>
51json valueToJson(const T& value)
52{
53 if constexpr (std::is_same_v<T, Properties>)
54 {
55 return value.toJson();
56 }
57 else if constexpr (std::is_same_v<T, int2> || std::is_same_v<T, int3> || std::is_same_v<T, int4>)
58 {
59 return vecToJson(value);
60 }
61 else if constexpr (std::is_same_v<T, uint2> || std::is_same_v<T, uint3> || std::is_same_v<T, uint4>)
62 {
63 return vecToJson(value);
64 }
65 else if constexpr (std::is_same_v<T, float2> || std::is_same_v<T, float3> || std::is_same_v<T, float4>)
66 {
67 return vecToJson(value);
68 }
69 else
70 {
71 return json(value);
72 }
73}
74
75template<typename VecT>
76VecT vecFromJson(const json& json, std::string_view name)

Callers

nothing calls this directly

Calls 2

vecToJsonFunction · 0.85
toJsonMethod · 0.80

Tested by

no test coverage detected