2 * Copyright (c) 2018 Samsung Electronics Co., Ltd.
4 * Licensed under the Flora License, Version 1.1 (the License);
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
8 * http://floralicense.org/license/
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an AS IS BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
17 #ifndef __CAR_INFO_SERIALIZER_H_
18 #define __CAR_INFO_SERIALIZER_H_
23 * @brief Serializes car_info_t struct into json string.
24 * @param[in] car_info The struct with car data.
25 * @return Json with car data.
26 * @remarks Returned value should be freed.
28 char *car_info_serializer_serialize(car_info_t *car_info);
31 * @brief Deserializes json string to array of car_info_t structs.
32 * @param[in] json_data Json string with config.
33 * @param[out] size Length of car_info_t array.
34 * @return Dynamically allocated car_info_t array or NULL on error.
35 * @remarks Returned array should be released with @free and its every element with @car_info_destroy.
37 car_info_t **car_info_serializer_deserialize_array(const char *json_data, int *size);