|
pjson 2.0.0
A small, owning JSON value for C++11
|
Controls JSON serialization. More...
#include <pjson.h>
Public Types | |
| enum | NonFinitePolicy { RejectNonFinite , NonFiniteToNull , NonFiniteToString } |
| Selects how stored NaN and infinity values are represented. More... | |
Public Member Functions | |
| SerializeOptions () | |
| Selects compact output, two-space indentation, and non-finite rejection. | |
Static Public Member Functions | |
| static SerializeOptions | prettyPrinted () |
| Returns the defaults with pretty printing enabled. | |
Public Attributes | |
| bool | pretty |
| Enables line breaks and indentation. | |
| size_t | indentWidth |
| Indentation characters per nesting level. | |
| char | indentCharacter |
| Space or tab; invalid values are treated as space. | |
| bool | escapeNonAscii |
| Emits non-ASCII code points as Unicode escapes. | |
| NonFinitePolicy | nonFinite |
| Policy for NaN and infinity values. | |
| size_t | maxOutputBytes |
| Output ceiling; zero explicitly means unlimited. | |
Controls JSON serialization.
The default produces compact output in native object-storage order. Pretty output places each array element/object member on its own line. Only space and tab are valid indentation characters; any other value is treated as a space so serialization always remains valid JSON.
Object storage and serialization order are unspecified.
| ByteDance::pjson::SerializeOptions::SerializeOptions | ( | ) |
Selects compact output, two-space indentation, and non-finite rejection.
|
static |
Returns the defaults with pretty printing enabled.
| bool ByteDance::pjson::SerializeOptions::escapeNonAscii |
| char ByteDance::pjson::SerializeOptions::indentCharacter |
| size_t ByteDance::pjson::SerializeOptions::indentWidth |
| size_t ByteDance::pjson::SerializeOptions::maxOutputBytes |
| NonFinitePolicy ByteDance::pjson::SerializeOptions::nonFinite |
| bool ByteDance::pjson::SerializeOptions::pretty |