json_util.h
Go to the documentation of this file.
1 
9 #ifndef JSON_UTIL_H_
10 #define JSON_UTIL_H_
11 
12 #include "mcl_core/mcl_json_util.h"
13 
21 
34 
48 MCL_LOCAL mcl_error_t json_util_start_array(mcl_json_t *root, const char *array_name, mcl_json_t **json_array);
49 
64 
77 
91 MCL_LOCAL mcl_error_t json_util_start_object(mcl_json_t *root, const char *object_name, mcl_json_t **json_object);
92 
109 MCL_LOCAL mcl_error_t json_util_add_string(mcl_json_t *root, const char *object_name, const char *object_value);
110 
127 MCL_LOCAL mcl_error_t json_util_add_uint(mcl_json_t *root, const char *object_name, const mcl_size_t number);
128 
143 MCL_LOCAL mcl_error_t json_util_add_double(mcl_json_t *root, const char *object_name, const double number);
144 
159 MCL_LOCAL mcl_error_t json_util_add_bool(mcl_json_t *root, const char *object_name, const mcl_bool_t bool_value);
160 
174 MCL_LOCAL mcl_error_t json_util_add_null(mcl_json_t *root, const char *object_name);
175 
189 MCL_LOCAL mcl_error_t json_util_add_object(mcl_json_t *root, const char *object_name, mcl_json_t *object);
190 
198 
213 MCL_LOCAL mcl_error_t json_util_get_object_item(mcl_json_t *json_parent, const char *child_name, mcl_json_t **json_child);
214 
226 
239 
251 MCL_LOCAL mcl_error_t json_util_get_double_value(mcl_json_t *json, double *double_value);
252 
265 
278 MCL_LOCAL mcl_error_t json_util_get_string(mcl_json_t *json, char **string_value);
279 
291 MCL_LOCAL mcl_error_t json_util_to_string(mcl_json_t *root, char **json_string);
292 
307 MCL_LOCAL mcl_error_t json_util_parse(const char *json_string, mcl_size_t size, mcl_json_t **root);
308 
320 MCL_LOCAL mcl_error_t json_util_duplicate(const mcl_json_t *source_json, mcl_json_t **duplicated_json);
321 
330 
331 #endif //JSON_UTIL_H_
#define MCL_LOCAL
MCL_LOCAL mcl_error_t json_util_get_object_item(mcl_json_t *json_parent, const char *child_name, mcl_json_t **json_child)
Definition: json_util.c:581
size_t mcl_size_t
MCL_LOCAL mcl_error_t json_util_start_array(mcl_json_t *root, const char *array_name, mcl_json_t **json_array)
Definition: json_util.c:107
int32_t mcl_int32_t
MCL_LOCAL mcl_error_t json_util_get_number_value(mcl_json_t *json, mcl_int32_t *number_value)
Definition: json_util.c:650
MCL_LOCAL mcl_error_t json_util_initialize(E_MCL_JSON_TYPE json_type, mcl_json_t **root)
Definition: json_util.c:57
void mcl_json_t
Definition: mcl_json_util.h:24
MCL_LOCAL mcl_error_t json_util_get_array_size(mcl_json_t *array, mcl_size_t *size)
Definition: json_util.c:192
mcl_int32_t mcl_error_t
MCL_LOCAL mcl_bool_t json_util_has_child(mcl_json_t *root)
Definition: json_util.c:617
MCL_LOCAL mcl_error_t json_util_add_object(mcl_json_t *root, const char *object_name, mcl_json_t *object)
Definition: json_util.c:512
MCL_LOCAL void json_util_destroy(mcl_json_t **root)
Definition: json_util.c:913
MCL_LOCAL void json_util_add_item_to_array(mcl_json_t *root, mcl_json_t *object)
Definition: json_util.c:554
MCL_LOCAL mcl_error_t json_util_get_double_value(mcl_json_t *json, double *double_value)
Definition: json_util.c:683
MCL_LOCAL void json_util_initialize_json_library(void)
Definition: json_util.c:30
MCL_LOCAL mcl_error_t json_util_duplicate(const mcl_json_t *source_json, mcl_json_t **duplicated_json)
Definition: json_util.c:887
MCL_LOCAL mcl_error_t json_util_add_uint(mcl_json_t *root, const char *object_name, const mcl_size_t number)
Definition: json_util.c:336
MCL_LOCAL mcl_error_t json_util_add_string(mcl_json_t *root, const char *object_name, const char *object_value)
Definition: json_util.c:273
E_MCL_JSON_TYPE
Definition: mcl_json_util.h:29
Json utility module interface header file.
MCL_LOCAL mcl_error_t json_util_start_object(mcl_json_t *root, const char *object_name, mcl_json_t **json_object)
Definition: json_util.c:226
MCL_LOCAL mcl_error_t json_util_get_bool_value(mcl_json_t *json, mcl_bool_t *bool_value)
Definition: json_util.c:716
MCL_LOCAL mcl_error_t json_util_add_bool(mcl_json_t *root, const char *object_name, const mcl_bool_t bool_value)
Definition: json_util.c:392
MCL_LOCAL mcl_error_t json_util_add_null(mcl_json_t *root, const char *object_name)
Definition: json_util.c:455
MCL_LOCAL mcl_error_t json_util_get_array_item(mcl_json_t *array, int index, mcl_json_t **item)
Definition: json_util.c:153
MCL_LOCAL mcl_error_t json_util_to_string(mcl_json_t *root, char **json_string)
Definition: json_util.c:809
mcl_uint8_t mcl_bool_t
MCL_LOCAL mcl_error_t json_util_parse(const char *json_string, mcl_size_t size, mcl_json_t **root)
Definition: json_util.c:844
MCL_LOCAL mcl_error_t json_util_add_double(mcl_json_t *root, const char *object_name, const double number)
Definition: json_util.c:364
MCL_LOCAL mcl_error_t json_util_get_string(mcl_json_t *json, char **string_value)
Definition: json_util.c:754