Lines Matching defs:json
34 __attribute__((always_inline)) inline char *GetStringFromJsonObj(const cJSON *json, const char *key)
36 APPSPAWN_CHECK_ONLY_EXPER(key != NULL && json != NULL, NULL);
37 APPSPAWN_CHECK(cJSON_IsObject(json), return NULL, "json is not object %{public}s", key);
38 cJSON *obj = cJSON_GetObjectItemCaseSensitive(json, key);
40 APPSPAWN_CHECK(cJSON_IsString(obj), return NULL, "json is not string %{public}s", key);
44 __attribute__((always_inline)) inline bool GetBoolValueFromJsonObj(const cJSON *json, const char *key, bool def)
46 char *value = GetStringFromJsonObj(json, key);
55 __attribute__((always_inline)) inline uint32_t GetIntValueFromJsonObj(const cJSON *json, const char *key, uint32_t def)
57 APPSPAWN_CHECK(json != NULL, return def, "Invalid json");
58 APPSPAWN_CHECK(cJSON_IsObject(json), return def, "json is not object.");
59 return cJSON_GetNumberValue(cJSON_GetObjectItemCaseSensitive(json, key));