MCPcopy Create free account
hub / github.com/PointCloudLibrary/pcl / parse_value

Function parse_value

outofcore/src/cJSON.cpp:282–294  ·  view source on GitHub ↗

Parser core - when encountering text, process appropriately. */

Source from the content-addressed store, hash-verified

280
281/* Parser core - when encountering text, process appropriately. */
282static const char *parse_value(cJSON *item,const char *value)
283{
284 if (!value) return nullptr; /* Fail on null. */
285 if (!strncmp(value,"null",4)) { item->type=cJSON_NULL; return value+4; }
286 if (!strncmp(value,"false",5)) { item->type=cJSON_False; return value+5; }
287 if (!strncmp(value,"true",4)) { item->type=cJSON_True; item->valueint=1; return value+4; }
288 if (*value=='\"') { return parse_string(item,value); }
289 if (*value=='-' || (*value>='0' && *value<='9')) { return parse_number(item,value); }
290 if (*value=='[') { return parse_array(item,value); }
291 if (*value=='{') { return parse_object(item,value); }
292
293 ep=value;return nullptr; /* failure. */
294}
295
296/* Render a value to text. */
297static char *print_value(cJSON *item,int depth,int fmt)

Callers 3

cJSON_ParseFunction · 0.85
parse_arrayFunction · 0.85
parse_objectFunction · 0.85

Calls 4

parse_stringFunction · 0.85
parse_numberFunction · 0.85
parse_arrayFunction · 0.85
parse_objectFunction · 0.85

Tested by

no test coverage detected