MCPcopy Create free account
hub / github.com/beefytech/Beef / print_value

Function print_value

BeefySysLib/util/Json.cpp:313–328  ·  view source on GitHub ↗

Render a value to text. */

Source from the content-addressed store, hash-verified

311
312/* Render a value to text. */
313static char *print_value(Json* item,int depth,int fmt)
314{
315 char *out=0;
316 if (!item) return 0;
317 switch ((item->mType)&255)
318 {
319 case Json::Type_NULL: out=JSON_strdup("null"); break;
320 case Json::Type_False: out=JSON_strdup("false");break;
321 case Json::Type_True: out=JSON_strdup("true"); break;
322 case Json::Type_Number: out=print_number(item);break;
323 case Json::Type_String: out=print_string(item);break;
324 case Json::Type_Array: out=print_array(item,depth,fmt);break;
325 case Json::Type_Object: out=print_object(item,depth,fmt);break;
326 }
327 return out;
328}
329
330/* Build an array from input text. */
331static const char *parse_array(Json* item,const char *value)

Callers 4

PrintMethod · 0.85
PrintUnformattedMethod · 0.85
print_arrayFunction · 0.85
print_objectFunction · 0.85

Calls 5

JSON_strdupFunction · 0.85
print_numberFunction · 0.85
print_stringFunction · 0.85
print_arrayFunction · 0.85
print_objectFunction · 0.85

Tested by

no test coverage detected