| 1442 CxJsonWriter writer = cxJsonWriterPretty(true); |
1442 CxJsonWriter writer = cxJsonWriterPretty(true); |
| 1443 return cx_json_to_string(value, allocator, &writer); |
1443 return cx_json_to_string(value, allocator, &writer); |
| 1444 } |
1444 } |
| 1445 |
1445 |
| 1446 int cxJsonCompare(const CxJsonValue *json, const CxJsonValue *other) { |
1446 int cxJsonCompare(const CxJsonValue *json, const CxJsonValue *other) { |
| 1447 if (json == NULL && other == NULL) return 0; |
1447 if (json == other) return 0; |
| 1448 if (json == NULL || other == NULL) return -1; |
1448 if (json == NULL || other == NULL) return -1; |
| 1449 if (json->type != other->type) { |
1449 if (json->type != other->type) { |
| 1450 if (!cxJsonIsNumber(json)) return -1; |
1450 if (!cxJsonIsNumber(json)) return -1; |
| 1451 if (!cxJsonIsNumber(other)) return -1; |
1451 if (!cxJsonIsNumber(other)) return -1; |
| 1452 } |
1452 } |