Json module header file. More...
Go to the source code of this file.
Functions | |
MCL_LOCAL mcl_error_t | json_from_item_meta (void *item, char **json_string) |
MCL_LOCAL mcl_error_t | json_from_item_payload (void *item, char **json_string) |
MCL_LOCAL mcl_size_t | json_get_item_size (void *item) |
MCL_LOCAL mcl_error_t | json_parse_item (const char *json_string, mcl_size_t string_length, void **item) |
Json module header file.
This module creates json strings for all data types.
Definition in file json.h.
MCL_LOCAL mcl_error_t json_from_item_meta | ( | void * | item, |
char ** | json_string | ||
) |
This function creates json representation of an item meta.
[in] | item | MCL item (Event, Timeseries, etc.). |
[out] | json_string | Json string representation of item meta. |
Definition at line 326 of file json.c.
References _add_item_meta_details(), _add_item_meta_payload(), ITEM_TYPE, ITEM_VERSION, MCL_DEBUG_ENTRY, MCL_DEBUG_LEAVE, MCL_JSON_OBJECT, mcl_json_util_add_string(), mcl_json_util_destroy(), mcl_json_util_initialize(), mcl_json_util_to_string(), MCL_NULL, MCL_OK, meta_field_names, META_FIELD_TYPE, and META_FIELD_VERSION.
Referenced by _add_item_meta_json().
MCL_LOCAL mcl_error_t json_from_item_payload | ( | void * | item, |
char ** | json_string | ||
) |
This function creates json representation of an item payload in a json array.
[in] | item | Item which will be used to create json string. |
[out] | json_string | Json string representation of item payload. |
Definition at line 370 of file json.c.
References _json_from_data_source_configuration_payload(), _json_from_event_payload(), _json_from_timeseries_payload(), MCL_DEBUG_ENTRY, MCL_DEBUG_LEAVE, MCL_FAIL, MCL_ITEM_TYPE_DATA_SOURCE_CONFIGURATION, MCL_ITEM_TYPE_EVENT, and MCL_ITEM_TYPE_TIMESERIES.
Referenced by _add_item_payload().
MCL_LOCAL mcl_size_t json_get_item_size | ( | void * | item | ) |
This function calculates the item size.
[in] | item | Item to calculate its size. |
Definition at line 429 of file json.c.
References _item_meta_size(), _item_payload_size_for_data_source_configuration(), _item_payload_size_for_event(), _item_payload_size_for_timeseries(), MCL_DEBUG_ENTRY, MCL_DEBUG_LEAVE, MCL_ITEM_TYPE_CUSTOM_DATA, MCL_ITEM_TYPE_DATA_SOURCE_CONFIGURATION, MCL_ITEM_TYPE_EVENT, MCL_ITEM_TYPE_FILE, and MCL_ITEM_TYPE_TIMESERIES.
Referenced by multipart_get_tuple_size().
MCL_LOCAL mcl_error_t json_parse_item | ( | const char * | json_string, |
mcl_size_t | string_length, | ||
void ** | item | ||
) |
This function parses json representation of an item to its struct (Currently, only for data source configuration).
[in] | json_string | Json string. |
[in] | string_length | Length of json string. |
[out] | item | Item struct. |
Definition at line 467 of file json.c.
References _parse_data_source_configuration(), MCL_DEBUG_ENTRY, MCL_DEBUG_LEAVE, mcl_json_util_destroy(), mcl_json_util_parse(), MCL_NULL, and MCL_OK.
Referenced by connectivity_processor_get_data_source_configuration().