MCPcopy Create free account
hub / github.com/OpenDriveLab/OpenLane / print_value

Function print_value

eval/LANE_evaluation/lane2d/src/cJSON.c:503–536  ·  view source on GitHub ↗

Render a value to text. */

Source from the content-addressed store, hash-verified

501
502/* Render a value to text. */
503static char *print_value(cJSON *item, int depth, int fmt)
504{
505 char *out = 0;
506 if (!item)
507 return 0;
508 switch ((item->type) & 255)
509 {
510 case cJSON_NULL:
511 out = cJSON_strdup("null");
512 break;
513 case cJSON_False:
514 out = cJSON_strdup("false");
515 break;
516 case cJSON_True:
517 out = cJSON_strdup("true");
518 break;
519 case cJSON_Int:
520 out = print_int(item);
521 break;
522 case cJSON_Double:
523 out = print_double(item);
524 break;
525 case cJSON_String:
526 out = print_string(item);
527 break;
528 case cJSON_Array:
529 out = print_array(item, depth, fmt);
530 break;
531 case cJSON_Object:
532 out = print_object(item, depth, fmt);
533 break;
534 }
535 return out;
536}
537
538/* Build an array from input text. */
539static const char *parse_array(cJSON *item, const char *value, const char **ep)

Callers 4

cJSON_PrintFunction · 0.85
cJSON_PrintUnformattedFunction · 0.85
print_arrayFunction · 0.85
print_objectFunction · 0.85

Calls 6

cJSON_strdupFunction · 0.85
print_intFunction · 0.85
print_doubleFunction · 0.85
print_stringFunction · 0.85
print_arrayFunction · 0.85
print_objectFunction · 0.85

Tested by

no test coverage detected