pjson 1.0.0
A small, owning JSON value for C++11
Loading...
Searching...
No Matches
ByteDance::pjson::SerializeOptions Struct Reference

Controls JSON serialization. The default produces the same compact, ascending-key output as toString()/write() without options. 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. More...

#include <pjson.h>

Public Types

enum  KeyOrder { AscendingKeys , DescendingKeys }
 Selects one of the public JSON policies. More...
 

Public Member Functions

 SerializeOptions ()
 Public API member SerializeOptions; see the API overview for its contract. / Returns the defaults with pretty printing enabled.
 

Static Public Member Functions

static SerializeOptions prettyPrinted ()
 Public API member prettyPrinted; see the API overview for its contract.
 

Public Attributes

bool pretty
 Public API member pretty; see the API overview for its contract.
 
size_t indentWidth
 Public API member indentWidth; see the API overview for its contract.
 
char indentCharacter
 Public API member indentCharacter; see the API overview for its contract.
 
bool escapeNonAscii
 Public API member escapeNonAscii; see the API overview for its contract.
 
KeyOrder keyOrder
 Public API member keyOrder; see the API overview for its contract.
 
size_t maxOutputBytes
 default 64 MiB; zero explicitly means unlimited
 

Detailed Description

Controls JSON serialization. The default produces the same compact, ascending-key output as toString()/write() without options. 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.

Objects are stored in std::map, so source/insertion order is not available. Key ordering is therefore explicitly ascending or descending according to std::map's bytewise std::string ordering.

Definition at line 239 of file pjson.h.

Member Enumeration Documentation

◆ KeyOrder

Selects one of the public JSON policies.

Enumerator
AscendingKeys 

JSON value or policy constant.

DescendingKeys 

JSON value or policy constant.

Definition at line 241 of file pjson.h.

Constructor & Destructor Documentation

◆ SerializeOptions()

ByteDance::pjson::SerializeOptions::SerializeOptions ( )

Public API member SerializeOptions; see the API overview for its contract. / Returns the defaults with pretty printing enabled.

Member Function Documentation

◆ prettyPrinted()

static SerializeOptions ByteDance::pjson::SerializeOptions::prettyPrinted ( )
static

Public API member prettyPrinted; see the API overview for its contract.

Member Data Documentation

◆ escapeNonAscii

bool ByteDance::pjson::SerializeOptions::escapeNonAscii

Public API member escapeNonAscii; see the API overview for its contract.

Definition at line 249 of file pjson.h.

◆ indentCharacter

char ByteDance::pjson::SerializeOptions::indentCharacter

Public API member indentCharacter; see the API overview for its contract.

Definition at line 248 of file pjson.h.

◆ indentWidth

size_t ByteDance::pjson::SerializeOptions::indentWidth

Public API member indentWidth; see the API overview for its contract.

Definition at line 247 of file pjson.h.

◆ keyOrder

KeyOrder ByteDance::pjson::SerializeOptions::keyOrder

Public API member keyOrder; see the API overview for its contract.

Definition at line 250 of file pjson.h.

◆ maxOutputBytes

size_t ByteDance::pjson::SerializeOptions::maxOutputBytes

default 64 MiB; zero explicitly means unlimited

Definition at line 251 of file pjson.h.

◆ pretty

bool ByteDance::pjson::SerializeOptions::pretty

Public API member pretty; see the API overview for its contract.

Definition at line 246 of file pjson.h.


The documentation for this struct was generated from the following file: