Render a value to text. */
| 311 | |
| 312 | /* Render a value to text. */ |
| 313 | static 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. */ |
| 331 | static const char *parse_array(Json* item,const char *value) |
no test coverage detected