16 #ifndef MCL_JSON_UTIL_H_ 17 #define MCL_JSON_UTIL_H_ 386 #endif //MCL_JSON_UTIL_H_ struct mcl_json_t mcl_json_t
This struct is used for json handling.
MCL_EXPORT E_MCL_ERROR_CODE mcl_json_util_get_bool_value(mcl_json_t *json, mcl_bool_t *bool_value)
This function gets the boolean value of a given json object.
MCL_EXPORT E_MCL_ERROR_CODE mcl_json_util_get_object_item(mcl_json_t *json_parent, const char *child_name, mcl_json_t **json_child)
This function gives the value of json_child object, when the child_name in json_parent object is give...
MCL_EXPORT E_MCL_ERROR_CODE mcl_json_util_add_item_to_array(mcl_json_t *root, mcl_json_t *object)
This function adds object to root array.
MCL_EXPORT E_MCL_ERROR_CODE mcl_json_util_to_string(mcl_json_t *root, char **json_string)
This function gives the string of root in json format.
MCL_EXPORT E_MCL_ERROR_CODE mcl_json_util_start_array(mcl_json_t *root, const char *array_name, mcl_json_t **json_array)
This function creates an array in root.
MCL_EXPORT E_MCL_ERROR_CODE mcl_json_util_add_uint(mcl_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.
MCL_EXPORT E_MCL_ERROR_CODE mcl_json_util_add_bool(mcl_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.
Common module interface header file.
MCL_EXPORT E_MCL_ERROR_CODE mcl_json_util_initialize(E_MCL_JSON_TYPE json_type, mcl_json_t **root)
This function initializes the given root json.
MCL_EXPORT E_MCL_ERROR_CODE mcl_json_util_get_double_value(mcl_json_t *json, double *double_value)
This function gets the double value of a given json object.
MCL_EXPORT void mcl_json_util_destroy(mcl_json_t **root)
This function destroys root.
MCL_EXPORT E_MCL_ERROR_CODE mcl_json_util_get_array_size(mcl_json_t *array, mcl_size_t *size)
This function returns the size of array.
MCL_EXPORT void mcl_json_util_finish_object(mcl_json_t **json_object)
This function destroys json_object data struct. But the object still exists in root json object...
E_MCL_ERROR_CODE
MCL Error code definitions. Every function returning an error code uses this enum values...
MCL_EXPORT E_MCL_ERROR_CODE mcl_json_util_add_object(mcl_json_t *root, const char *object_name, mcl_json_t *object)
This function adds object to root.
E_MCL_JSON_TYPE
Json type definitions.
MCL_EXPORT E_MCL_ERROR_CODE mcl_json_util_get_array_item(mcl_json_t *array, int index, mcl_json_t **item)
This function gets the item at given index from array.
MCL_EXPORT E_MCL_ERROR_CODE mcl_json_util_add_double(mcl_json_t *root, const char *object_name, const double number)
This function adds double number to root which can be object or array.
MCL_EXPORT E_MCL_ERROR_CODE mcl_json_util_get_string(mcl_json_t *json_item, char **string_value)
This function gets the string value of a given json object.
MCL_EXPORT E_MCL_ERROR_CODE mcl_json_util_add_string(mcl_json_t *root, const char *object_name, const char *object_value)
This function adds string to root which can be object or array.
MCL_EXPORT E_MCL_ERROR_CODE mcl_json_util_get_number_value(mcl_json_t *json, mcl_int32_t *number_value)
This function gets the number value of a given json object.
MCL_EXPORT E_MCL_ERROR_CODE mcl_json_util_parse(const char *json_string, mcl_json_t **root)
This function parses the given string to the given json object.
MCL_EXPORT void mcl_json_util_finish_array(mcl_json_t **json_array)
This function destroys json_array data struct. But the array still exists in root json object...
MCL_EXPORT E_MCL_ERROR_CODE mcl_json_util_has_child(mcl_json_t *root, mcl_bool_t *result)
This function checks whether root object has child object or not.
MCL_EXPORT E_MCL_ERROR_CODE mcl_json_util_add_float(mcl_json_t *root, const char *object_name, const float number)
This function adds floating number to root.
MCL_EXPORT E_MCL_ERROR_CODE mcl_json_util_add_null(mcl_json_t *root, const char *object_name)
This function adds null to root which can be object or array.
MCL_EXPORT E_MCL_ERROR_CODE mcl_json_util_start_object(mcl_json_t *root, const char *object_name, mcl_json_t **json_object)
This function creates an object in root.