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

Method EncodeNlohmannJson

lib/base/json.cpp:190–194  ·  view source on GitHub ↗

* Dumps a nlohmann::json object to the output stream using the serializer. * * This function uses the @c nlohmann::detail::serializer to dump the provided @c nlohmann::json * object to the output stream managed by the @c JsonEncoder. Strings will be properly escaped, and * if any invalid UTF-8 sequences are encountered, it will replace them with the Unicode replacement * character (U+FFFD).

Source from the content-addressed store, hash-verified

188 * @param json The nlohmann::json object to encode.
189 */
190void JsonEncoder::EncodeNlohmannJson(const nlohmann::json& json) const
191{
192 nlohmann::detail::serializer<nlohmann::json> s(m_Writer, ' ', nlohmann::json::error_handler_t::replace);
193 s.dump(json, m_Pretty, true, 0, 0);
194}
195
196/**
197 * Encodes a double value into JSON format and writes it to the output stream.

Callers

nothing calls this directly

Calls 1

dumpMethod · 0.80

Tested by

no test coverage detected