ecs_array_to_json

Function ecs_array_to_json 

Source
pub unsafe extern "C" fn ecs_array_to_json(
    world: *const ecs_world_t,
    type_: ecs_entity_t,
    data: *const c_void,
    count: i32,
) -> *mut c_char
Expand description

Serialize array into JSON string. This operation serializes a value of the provided type to a JSON string. The memory pointed to must be large enough to contain a value of the used type.

If count is 0, the function will serialize a single value, not wrapped in array brackets. If count is >= 1, the operation will serialize values to a a comma-separated list inside of array brackets.

@param world The world. @param type The type of the value to serialize. @param data The value to serialize. @param count The number of elements to serialize. @return String with JSON expression, or NULL if failed.