Add getNumberValue function

* Add GetNumberValue function and testcase

Co-authored-by: Alan Wang <[email protected]>
This commit is contained in:
Sang-Heon Jeon
2020-04-02 19:36:35 +08:00
committed by Alanscut
co-authored by Alan Wang
parent 983bb2b4d6
commit 97cf1d84e4
3 changed files with 31 additions and 4 deletions
+3 -2
View File
@@ -180,8 +180,9 @@ CJSON_PUBLIC(cJSON_bool) cJSON_HasObjectItem(const cJSON *object, const char *st
/* For analysing failed parses. This returns a pointer to the parse error. You'll probably need to look a few chars back to make sense of it. Defined when cJSON_Parse() returns 0. 0 when cJSON_Parse() succeeds. */
CJSON_PUBLIC(const char *) cJSON_GetErrorPtr(void);
/* Check if the item is a string and return its valuestring */
CJSON_PUBLIC(char *) cJSON_GetStringValue(const cJSON * const item);
/* Check item type and return its value */
CJSON_PUBLIC(char *) cJSON_GetStringValue(cJSON *item);
CJSON_PUBLIC(double) cJSON_GetNumberValue(cJSON *item);
/* These functions check the type of an item */
CJSON_PUBLIC(cJSON_bool) cJSON_IsInvalid(const cJSON * const item);