MCPcopy Create free account
hub / github.com/OpenStarbound/OpenStarbound / putValue

Method putValue

source/core/StarFormattedJson.cpp:595–605  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

593}
594
595void FormattedJsonBuilderStream::putValue(Json const& value, Maybe<String> formatting) {
596 FormattedJson formattedValue = value;
597 if (formatting.isValid())
598 formattedValue = formattedValue.formattedAs(*formatting);
599
600 if (m_stack.size() > 0)
601 current().appendElement(ValueElement{formattedValue});
602 else {
603 m_root = formattedValue;
604 }
605}
606
607void JsonStreamer<FormattedJson>::toJsonStream(FormattedJson const& val, JsonStream& stream, bool sort) {
608 if (val.isType(Json::Type::Object))

Callers

nothing calls this directly

Calls 4

isValidMethod · 0.80
formattedAsMethod · 0.80
appendElementMethod · 0.80
sizeMethod · 0.45

Tested by

no test coverage detected