MCPcopy Create free account
hub / github.com/Icinga/icinga2 / WriteSeparatorAndIndentStrIfNeeded

Method WriteSeparatorAndIndentStrIfNeeded

lib/base/json.cpp:283–292  ·  view source on GitHub ↗

* Writes a separator (comma) and an indentation string if pretty-printing is enabled. * * This function is used to separate items in a JSON array or object and to maintain the correct indentation level. * * @param emitComma Whether to emit a comma. This is typically true for all but the first item in a container. */

Source from the content-addressed store, hash-verified

281 * @param emitComma Whether to emit a comma. This is typically true for all but the first item in a container.
282 */
283void JsonEncoder::WriteSeparatorAndIndentStrIfNeeded(bool emitComma) const
284{
285 if (emitComma) {
286 Write(",");
287 }
288 if (m_Pretty) {
289 Write("\n");
290 m_Writer->write_characters(m_IndentStr.c_str(), m_Indent);
291 }
292}
293
294/**
295 * Wraps any writer of type @c nlohmann::detail::output_adapter_t<char> into a Flusher

Callers

nothing calls this directly

Calls 1

write_charactersMethod · 0.80

Tested by

no test coverage detected