toJSON - multiple declarations

Function toJSON

Takes a tree of JSON values and returns the serialized string.

string toJSON (
  ref const(JSONValue) root,
  in const(bool) pretty = false,
  in const(JSONOptions) options = JSONOptions.none
) @safe;

Any Object types will be serialized in a key-sorted order.

If pretty is false no whitespaces are generated. If pretty is true serialized string is formatted to be human-readable. Set the JSONOptions.specialFloatLiterals flag is set in options to encode NaN/Infinity as strings.

Function toJSON

void toJSON(Out) (
  auto ref Out json,
  const ref JSONValue root,
  in bool pretty = false,
  in JSONOptions options = JSONOptions.none
)
if (isOutputRange!(Out, char));