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

Function emit_value

crawl-ref/source/json.cc:1039–1065  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1037}
1038
1039static void emit_value(SB *out, const JsonNode *node)
1040{
1041 ASSERT(tag_is_valid(node->tag));
1042 switch (node->tag)
1043 {
1044 case JSON_NULL:
1045 sb_puts(out, "null");
1046 break;
1047 case JSON_BOOL:
1048 sb_puts(out, node->bool_ ? "true" : "false");
1049 break;
1050 case JSON_STRING:
1051 emit_string(out, node->string_);
1052 break;
1053 case JSON_NUMBER:
1054 emit_number(out, node->number_);
1055 break;
1056 case JSON_ARRAY:
1057 emit_array(out, node);
1058 break;
1059 case JSON_OBJECT:
1060 emit_object(out, node);
1061 break;
1062 default:
1063 die("invalid JSON tag type");
1064 }
1065}
1066
1067void emit_value_indented(SB *out, const JsonNode *node, const char *space, int indent_level)
1068{

Callers 2

json_stringifyFunction · 0.85
json_foreachFunction · 0.85

Calls 7

tag_is_validFunction · 0.85
sb_putsFunction · 0.85
emit_stringFunction · 0.85
emit_numberFunction · 0.85
emit_arrayFunction · 0.85
emit_objectFunction · 0.85
dieFunction · 0.70

Tested by

no test coverage detected