nlohmann::basic_json::dump

serialization

Synopsis

Declared in <nlohmann/json.hpp>

string_t
dump(
    int const indent = -1,
    char const indent_char = ' ',
    bool const ensure_ascii = false,
    error_handler_t const error_handler = error_handler_t::strict) const;

Return Value

string containing the serialization of the JSON value

Parameters

NameDescription
indentif nonnegative, pretty-print with this number of indentation spaces per level; if negative (the default), the most compact representation is produced
indent_charcharacter used for indentation if indent is nonnegative
ensure_asciiif true, all non-ASCII characters in the output are escaped with uXXXX sequences
error_handlerhow to handle invalid UTF-8 sequences encountered while serializing