MCPcopy Create free account
hub / github.com/ablab/spades / value

Method value

ext/src/llvm/JSON.cpp:593–626  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

591}
592
593void llvm::json::OStream::value(const Value &V) {
594 switch (V.kind()) {
595 case Value::Null:
596 valueBegin();
597 OS << "null";
598 return;
599 case Value::Boolean:
600 valueBegin();
601 OS << (*V.getAsBoolean() ? "true" : "false");
602 return;
603 case Value::Number:
604 valueBegin();
605 if (V.Type == Value::T_Integer)
606 OS << *V.getAsInteger();
607 else
608 OS << format("%.*g", std::numeric_limits<double>::max_digits10,
609 *V.getAsNumber());
610 return;
611 case Value::String:
612 valueBegin();
613 quote(OS, *V.getAsString());
614 return;
615 case Value::Array:
616 return array([&] {
617 for (const Value &E : *V.getAsArray())
618 value(E);
619 });
620 case Value::Object:
621 return object([&] {
622 for (const Object::value_type *E : sortedElements(*V.getAsObject()))
623 attribute(E->first, E->second);
624 });
625 }
626}
627
628void llvm::json::OStream::valueBegin() {
629 assert(Stack.back().Ctx != Object && "Only attributes allowed here");

Callers 5

formatMethod · 0.45
beginSequenceMethod · 0.45
matchEnumScalarMethod · 0.45
bitSetMatchMethod · 0.45
scalarStringMethod · 0.45

Calls 12

quoteFunction · 0.85
sortedElementsFunction · 0.85
getAsBooleanMethod · 0.80
getAsNumberMethod · 0.80
getAsStringMethod · 0.80
getAsArrayMethod · 0.80
getAsObjectMethod · 0.80
formatFunction · 0.50
arrayClass · 0.50
valueFunction · 0.50
kindMethod · 0.45
getAsIntegerMethod · 0.45

Tested by

no test coverage detected