MCPcopy Create free account
hub / github.com/crawl/crawl / emit_value_indented

Function emit_value_indented

crawl-ref/source/json.cc:1067–1093  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1065}
1066
1067void emit_value_indented(SB *out, const JsonNode *node, const char *space, int indent_level)
1068{
1069 ASSERT(tag_is_valid(node->tag));
1070 switch (node->tag)
1071 {
1072 case JSON_NULL:
1073 sb_puts(out, "null");
1074 break;
1075 case JSON_BOOL:
1076 sb_puts(out, node->bool_ ? "true" : "false");
1077 break;
1078 case JSON_STRING:
1079 emit_string(out, node->string_);
1080 break;
1081 case JSON_NUMBER:
1082 emit_number(out, node->number_);
1083 break;
1084 case JSON_ARRAY:
1085 emit_array_indented(out, node, space, indent_level);
1086 break;
1087 case JSON_OBJECT:
1088 emit_object_indented(out, node, space, indent_level);
1089 break;
1090 default:
1091 die("invalid JSON tag type");
1092 }
1093}
1094
1095static void emit_array(SB *out, const JsonNode *array)
1096{

Callers 3

json_stringifyFunction · 0.85
emit_array_indentedFunction · 0.85
emit_object_indentedFunction · 0.85

Calls 7

tag_is_validFunction · 0.85
sb_putsFunction · 0.85
emit_stringFunction · 0.85
emit_numberFunction · 0.85
emit_array_indentedFunction · 0.85
emit_object_indentedFunction · 0.85
dieFunction · 0.70

Tested by

no test coverage detected