ludus::foundation::serialization¶
Ludus Wiki · API overview · Browse API
Namespace
Declared in modules/foundation/serialization/include/ludus/foundation/serialization/json.hpp
Constants and variables¶
MAX_DOCUMENT_BYTES¶
constexpr usize ludus::foundation::serialization::MAX_DOCUMENT_BYTES = 65536
Related types: usize
Declared in modules/foundation/serialization/include/ludus/foundation/serialization/json.hpp
Functions¶
ReadJson¶
reflection::Status ludus::foundation::serialization::ReadJson(const reflection::Schema &schema, std::string_view input, std::span< reflection::Value > output, const AllocationDomain &domain, reflection::Diagnostic &error) noexcept
Strict scalar authored envelope: schema UUID, exact version, values object.
Unknown/nonpersistent/duplicate fields fail; absent persistent fields use that exact schema version's declared defaults. No migrations are implicit. Decode uses one bounded fallible parser pool and bounded stack staging. Failure leaves output unchanged. Nonpersistent slots contain schema defaults; generated typed decoders preserve the corresponding native members instead.
Related types: AllocationDomain · reflection::Status · reflection::Diagnostic · reflection::Schema · reflection::Value
Declared in modules/foundation/serialization/include/ludus/foundation/serialization/json.hpp
WriteJson¶
reflection::Status ludus::foundation::serialization::WriteJson(const reflection::Schema &schema, std::span< const reflection::Value > values, std::span< uint8 > storage, std::span< const uint8 > &output, reflection::Diagnostic &error) noexcept
Writes every persistent field in declaration order, exact integers and finite floats.
Storage can contain a failed prefix, but output is published only on success. Caller must not alias storage with the values/metadata.
Related types: uint8 · reflection::Status · reflection::Diagnostic · reflection::Schema · reflection::Value
Declared in modules/foundation/serialization/include/ludus/foundation/serialization/json.hpp