383 #endif //JSON_UTIL_H_ struct mcl_json_t mcl_json_t
This struct is used for json handling.
E_MCL_ERROR_CODE json_util_add_string(json_t *root, const char *object_name, const char *object_value)
This function adds string to root which can be object or array.
void json_util_get_double_value(json_t *json, double *double_value)
This function gets the double value of a given json object.
void json_util_add_item_to_array(json_t *root, json_t *object)
This function adds object to root array.
E_MCL_ERROR_CODE json_util_parse_with_size(const char *json_string, mcl_size_t size, json_t **root)
This function parses the given string to the given json object.
cJSON * root_handle
Root cJson object.
void json_util_destroy(json_t **root)
This function destroys root.
Common module interface header file.
E_MCL_ERROR_CODE json_util_add_float(json_t *root, const char *object_name, const float number)
This function adds floating number to root.
E_MCL_ERROR_CODE json_util_add_null(json_t *root, const char *object_name)
This function adds null to root which can be object or array.
void json_util_initialize_json_library()
This function initializes json library.
E_MCL_ERROR_CODE json_util_get_array_item(json_t *array, int index, json_t **item)
This function gets the item at given index from array.
E_MCL_ERROR_CODE
MCL Error code definitions. Every function returning an error code uses this enum values...
void json_util_get_number_value(json_t *json, mcl_int32_t *number_value)
This function gets the number value of a given json object.
E_MCL_ERROR_CODE json_util_start_object(json_t *root, const char *object_name, json_t **json_object)
This function creates an object in root.
E_MCL_ERROR_CODE json_util_duplicate(const json_t *source_json, mcl_bool_t with_children, json_t **duplicated_json)
This function duplicates source_json as duplicated_json.
void json_util_get_array_size(json_t *array, mcl_size_t *size)
This function returns the size of array.
E_MCL_ERROR_CODE json_util_start_array(json_t *root, const char *array_name, json_t **json_array)
This function creates an array in root.
E_MCL_ERROR_CODE json_util_add_object(json_t *root, const char *object_name, json_t *object)
This function adds object to root.
void json_util_finish_array(json_t **json_array)
This function destroys json_array data struct. But the array still exists in root json object...
E_MCL_ERROR_CODE json_util_to_string(json_t *root, char **json_string)
This function gives the string of root in json format.
void json_util_finish_object(json_t **json_object)
This function destroys json_object data struct. But the object still exists in root json object...
String type module header file.
E_MCL_ERROR_CODE json_util_add_double(json_t *root, const char *object_name, const double number)
This function adds double number to root which can be object or array.
E_MCL_ERROR_CODE json_util_add_uint(json_t *root, const char *object_name, const mcl_size_t number)
This function adds integer number to root which can be object or array.
E_MCL_ERROR_CODE json_util_initialize(E_JSON_TYPE json_type, json_t **root)
This function initializes the given root json.
E_MCL_ERROR_CODE json_util_get_object_item(json_t *json_parent, const char *child_name, json_t **json_child)
This function gives the value of json_child object, when the child_name in json_parent object is give...
E_MCL_ERROR_CODE json_util_parse(const char *json_string, json_t **root)
This function parses the given string to the given json object.
This struct is used for json handling.
E_MCL_ERROR_CODE json_util_add_bool(json_t *root, const char *object_name, const mcl_bool_t bool_value)
This function adds bool_value to root which can be object or array.
void json_util_get_bool_value(json_t *json, mcl_bool_t *bool_value)
This function gets the boolean value of a given json object.
mcl_bool_t json_util_has_child(json_t *root)
This function checks whether root object has child object or not.
E_MCL_ERROR_CODE json_util_get_string(json_t *json_item, string_t **string_value)
This function gets the string value of a given json object.