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

Function emit_array_indented

crawl-ref/source/json.cc:1109–1133  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1107}
1108
1109static void emit_array_indented(SB *out, const JsonNode *array, const char *space, int indent_level)
1110{
1111 const JsonNode *element = array->children.head;
1112 int i;
1113
1114 if (element == nullptr)
1115 {
1116 sb_puts(out, "[]");
1117 return;
1118 }
1119
1120 sb_puts(out, "[\n");
1121 while (element != nullptr)
1122 {
1123 for (i = 0; i < indent_level + 1; i++)
1124 sb_puts(out, space);
1125 emit_value_indented(out, element, space, indent_level + 1);
1126
1127 element = element->next;
1128 sb_puts(out, element != nullptr ? ",\n" : "\n");
1129 }
1130 for (i = 0; i < indent_level; i++)
1131 sb_puts(out, space);
1132 sb_putc(out, ']');
1133}
1134
1135static void emit_object(SB *out, const JsonNode *object)
1136{

Callers 1

emit_value_indentedFunction · 0.85

Calls 2

sb_putsFunction · 0.85
emit_value_indentedFunction · 0.85

Tested by

no test coverage detected