diff options
author | Milo Yip <miloyip@gmail.com> | 2014-08-09 17:37:02 +0400 |
---|---|---|
committer | Milo Yip <miloyip@gmail.com> | 2014-08-09 17:37:02 +0400 |
commit | 1900b7bacea0d3329cd3ecc7aba4262b4bea8307 (patch) | |
tree | 9267ebd471e1eea7f4c1621a855bfd8aa7a70ebc /doc | |
parent | 0d915644a4cf03ef14ecffe54e6b8cb506fd40e9 (diff) |
Remove double precision settings API in Writer
Diffstat (limited to 'doc')
-rw-r--r-- | doc/sax.md | 16 |
1 files changed, 1 insertions, 15 deletions
@@ -225,7 +225,7 @@ You may doubt that, why not just using `sprintf()` or `std::stringstream` to bui There are various reasons: 1. `Writer` must output a well-formed JSON. If there is incorrect event sequence (e.g. `Int()` just after `StartObject()`), it generates assertion fail in debug mode. 2. `Writer::String()` can handle string escaping (e.g. converting code point `U+000A` to `\n`) and Unicode transcoding. -3. `Writer` handles number output consistently. For example, user can set precision for `Double()`. +3. `Writer` handles number output consistently. 4. `Writer` implements the event handler concept. It can be used to handle events from `Reader`, `Document` or other event publisher. 5. `Writer` can be optimized for different platforms. @@ -258,20 +258,6 @@ The last one, `Allocator` is the type of allocator, which is used for allocating Besides, the constructor of `Writer` has a `levelDepth` parameter. This parameter affects the initial memory allocated for storing information per hierarchy level. -## Precision (#WriterPrecision) - -When using `Double()`, the precision of output can be specified, for example: - -~~~~~~~~~~cpp -writer.SetDoublePrecision(4); -writer.StartArary(); -writer.Double(3.14159265359); -writer.EndArray(); -~~~~~~~~~~ -~~~~~~~~~~ -[3.1416] -~~~~~~~~~~ - ## PrettyWriter {#PrettyWriter} While the output of `Writer` is the most condensed JSON without white-spaces, suitable for network transfer or storage, it is not easily readable by human. |