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

Bounds how much work a parse may do. Parsing always enforces RFC 8259 conformance and rejects: More...

#include <pjson.h>

Public Types

enum  DuplicateKeyPolicy { RejectDuplicateKeys , KeepFirstDuplicate , KeepLastDuplicate }
 Selects one of the public JSON policies. More...
 

Public Member Functions

 ParseOptions ()
 Public API member ParseOptions; see the API overview for its contract.
 

Public Attributes

int maxDepth
 nesting limit; values <= 0 enforce a one-level limit
 
size_t maxNodes
 max JSON values created (0 = unlimited)
 
size_t maxInputBytes
 max input length in bytes (0 = unlimited)
 
DuplicateKeyPolicy duplicateKeys
 Public API member duplicateKeys; see the API overview for its contract. / Selects duplicate rejection, depth 512, one million nodes, and a / 64 MiB input limit.
 

Detailed Description

Bounds how much work a parse may do. Parsing always enforces RFC 8259 conformance and rejects:

  • unknown escapes (e.g. "\\q")
  • lone/unpaired \u surrogates
  • upper/mixed-case keywords (NULL, True, FALSE)
  • raw control characters inside strings
  • malformed UTF-8 bytes

Definition at line 117 of file pjson.h.

Member Enumeration Documentation

◆ DuplicateKeyPolicy

Selects one of the public JSON policies.

Enumerator
RejectDuplicateKeys 

JSON value or policy constant.

KeepFirstDuplicate 

JSON value or policy constant.

KeepLastDuplicate 

JSON value or policy constant.

Definition at line 119 of file pjson.h.

Constructor & Destructor Documentation

◆ ParseOptions()

ByteDance::pjson::ParseOptions::ParseOptions ( )

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

Member Data Documentation

◆ duplicateKeys

DuplicateKeyPolicy ByteDance::pjson::ParseOptions::duplicateKeys

Public API member duplicateKeys; see the API overview for its contract. / Selects duplicate rejection, depth 512, one million nodes, and a / 64 MiB input limit.

Definition at line 128 of file pjson.h.

◆ maxDepth

int ByteDance::pjson::ParseOptions::maxDepth

nesting limit; values <= 0 enforce a one-level limit

Definition at line 125 of file pjson.h.

◆ maxInputBytes

size_t ByteDance::pjson::ParseOptions::maxInputBytes

max input length in bytes (0 = unlimited)

Definition at line 127 of file pjson.h.

◆ maxNodes

size_t ByteDance::pjson::ParseOptions::maxNodes

max JSON values created (0 = unlimited)

Definition at line 126 of file pjson.h.


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