vibe.d beta banner
get vibe.d
0.10.1

Asynchronous I/O that doesn’t get in your way, written in D

Function Json.toString

Returns the JSON object as a string.

string toString() @trusted const;

void toString (
  scope @safe void delegate(scope const(char)[]) sink,
  std.format.spec.FormatSpec!(char) fmt
) @trusted;

void toString (
  scope void delegate(scope const(char)[]) sink,
  std.format.spec.FormatSpec!(char) fmt
);

deprecated void toString (
  scope @safe void delegate(const(char)[]) sink,
  std.format.spec.FormatSpec!(char) fmt
) @trusted;

void toString (
  scope void delegate(const(char)[]) sink,
  std.format.spec.FormatSpec!(char) fmt
);

For large JSON values use writeJsonString instead as this function will store the whole string in memory, whereas writeJsonString writes it out bit for bit.

See Also

writeJsonString, toPrettyString

Authors

Sönke Ludwig

Copyright

© 2012-2015 Sönke Ludwig

License

Subject to the terms of the MIT license, as written in the included LICENSE.txt file.