Write a JSON text representation of json to output.

Synopsis

Declared in <bdljsn_jsonutil.h>

static
int
write(
    std::string* output,
    Json const& json);

Description

Write to the specified output a JSON text representation of the specified json document, using the optionally specified options for formatting the resulting text. Return 0 on success, and a non‐zero value otherwise. Note that this operation will report an error only if there is an error writing to output.

Return Value

0 on success, and a non‐zero value otherwise

Parameters

Name

Description

output

string to receive the JSON text

json

document to serialize

Created with MrDocs