RDK Documentation (Open Sourced RDK Components)
FakeCJSON.cpp
1 /*
2 * If not stated otherwise in this file or this component's license file the
3 * following copyright and licenses apply:
4 *
5 * Copyright 2022 RDK Management
6 *
7 * Licensed under the Apache License, Version 2.0 (the "License");
8 * you may not use this file except in compliance with the License.
9 * You may obtain a copy of the License at
10 *
11 * http://www.apache.org/licenses/LICENSE-2.0
12 *
13 * Unless required by applicable law or agreed to in writing, software
14 * distributed under the License is distributed on an "AS IS" BASIS,
15 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16 * See the License for the specific language governing permissions and
17 * limitations under the License.
18 *
19 * Fake implementations of APIs from cJSON which is:
20 * Copyright (c) 2009-2017 Dave Gamble and cJSON contributors
21 * Licensed under the MIT License
22 */
23 
24 #include "cjson/cJSON.h"
25 
26 CJSON_PUBLIC(cJSON *) cJSON_Parse(const char *value)
27 {
28  return nullptr;
29 }
30 
31 CJSON_PUBLIC(void) cJSON_free(void *object)
32 {
33 }
34 
35 CJSON_PUBLIC(cJSON *) cJSON_GetObjectItem(const cJSON * const object, const char * const string)
36 {
37  return nullptr;
38 }
39 
40 CJSON_PUBLIC(void) cJSON_Delete(cJSON *item)
41 {
42 
43 }
44 
45 CJSON_PUBLIC(int) cJSON_GetArraySize(const cJSON *array)
46 {
47  return 0;
48 }
49 
50 CJSON_PUBLIC(cJSON_bool) cJSON_IsNumber(const cJSON * const item)
51 {
52  return cJSON_False;
53 }
54 
55 CJSON_PUBLIC(const char *) cJSON_GetErrorPtr(void)
56 {
57  return (const char *)"";
58 }
59 
60 CJSON_PUBLIC(cJSON *) cJSON_CreateArray(void)
61 {
62  return nullptr;
63 }
64 
65 CJSON_PUBLIC(cJSON *) cJSON_CreateObject(void)
66 {
67  return nullptr;
68 }
69 CJSON_PUBLIC(cJSON_bool) cJSON_AddItemToArray(cJSON *array, cJSON *item)
70 {
71  return cJSON_False;
72 }
73 
74 CJSON_PUBLIC(cJSON*) cJSON_AddBoolToObject(cJSON * const object, const char * const name, const cJSON_bool boolean)
75 {
76  return nullptr;
77 }
78 
79 CJSON_PUBLIC(cJSON*) cJSON_AddNumberToObject(cJSON * const object, const char * const name, const double number)
80 {
81  return nullptr;
82 }
83 
84 CJSON_PUBLIC(cJSON*) cJSON_AddStringToObject(cJSON * const object, const char * const name, const char * const string)
85 {
86  return nullptr;
87 }
88 
89 CJSON_PUBLIC(cJSON*) cJSON_AddObjectToObject(cJSON * const object, const char * const name)
90 {
91  return nullptr;
92 }
93 
94 CJSON_PUBLIC(cJSON*) cJSON_AddArrayToObject(cJSON * const object, const char * const name)
95 {
96  return nullptr;
97 }
98 
99 CJSON_PUBLIC(char *) cJSON_Print(const cJSON *item)
100 {
101  return (char *)"";
102 }
103 
104 CJSON_PUBLIC(char *) cJSON_PrintUnformatted(const cJSON *item)
105 {
106  return (char *)"";
107 }
108