* 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).
| 188 | * @param json The nlohmann::json object to encode. |
| 189 | */ |
| 190 | void 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. |