ark::serialization::JsonObjectWriter

Defined in header “ark/serialization/json_writer.hh”.


Creates a new JSON document, allowing you to write out objects/arrays/values into a JSON message.

Methods

  • JsonObjectWriter make_object(const std::string_view & name)
    Creates a new object at the given key name.

  • JsonWriteOnlyArray make_array(const std::string_view & name)
    Creates a new array at the given key name.

  • void set_value(const std::string_view & name, JsonWriteOnlyValue value)
    Creates a new value at the given key name.

  • JsonObjectWriter get_object(const std::string & name)
    Gets a nested object with the given name. Throws if no such key exists.

  • JsonWriteOnlyValue value()
    Returns the object as a mutable value.