json_encoder_add_property_name()

Create a property in the JSON encoder

Synopsis:

#include <sys/json.h>
json_encoder_error_t json_encoder_add_property_name(
                                                  json_encoder_t *encoder,
                                                  const char *name);

Arguments:

encoder
The JSON encoder instance.
name
The new property's name.

Library:

libjson

Description:

This function creates a property with the given name in the current object or array in the given JSON encoder. The value for the property is provided in a subsequent json_encoder_add_*() or json_encoder_start_*() call with NULL passed in for the function's name parameter.

Returns:

JSON_ENCODER_OK
Success.
JSON_ENCODER_NO_MEMORY
There is not enough memory to perform the operation.
JSON_ENCODER_MISSING_PROPERTY_NAME
No name was provided for the property.