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

◆ encode()

template<typename T >
std::string MayaFlux::IO::JSONSerializer::encode ( const T value,
int  indent = 2 
)
inline

Serialize value to a JSON string.

Template Parameters
TAny Reflectable struct, std::vector<Reflectable>, arithmetic type, std::string, std::optional<T>, std::unordered_map, or glm vec/mat type.
Parameters
indentSpaces per indentation level (-1 for compact).

Definition at line 52 of file JSONSerializer.hpp.

53 {
54 return to_json(value).dump(indent);
55 }
static nlohmann::json to_json(const T &val)