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

Structured result for DOM and SAX parsing. More...

#include <pjson_parser.h>

Public Types

enum  Code {
  None = 0 , Syntax , InvalidEncoding , DuplicateKey ,
  NumberRange , DepthLimit , InputLimit , NodeLimit ,
  AllocationFailure , StreamError , CallbackError , InvalidArgument
}
 Stable categories for programmatic parse-failure handling. More...
 

Public Attributes

bool ok
 True when the most recent parse succeeded.
 
Code code
 Stable machine-facing result category.
 
size_t offset
 Zero-based input byte offset.
 
size_t line
 One-based source line.
 
size_t column
 One-based byte column.
 
std::string message
 Human-readable diagnostic; wording is not stable. Constructs the successful start-of-input state.
 

Detailed Description

Structured result for DOM and SAX parsing.

Definition at line 41 of file pjson_parser.h.

Member Enumeration Documentation

◆ Code

Stable categories for programmatic parse-failure handling.

Enumerator
None 

Parsing succeeded.

Syntax 

The input violates JSON grammar.

InvalidEncoding 

UTF-8 or an escaped Unicode value is invalid.

DuplicateKey 

A repeated object name was rejected.

NumberRange 

A number is outside the configured representation policy.

DepthLimit 

Nesting exceeded the effective depth limit.

InputLimit 

Input exceeded maxInputBytes.

NodeLimit 

Values processed exceeded maxNodes.

AllocationFailure 

Parser, DOM, or callback allocation failed.

StreamError 

Reading from the input stream failed.

CallbackError 

A SAX callback cancelled or threw.

InvalidArgument 

The caller supplied an invalid argument.

Definition at line 43 of file pjson_parser.h.

Member Data Documentation

◆ code

Code ByteDance::pJsonParser::Error::code

Stable machine-facing result category.

Definition at line 59 of file pjson_parser.h.

◆ column

size_t ByteDance::pJsonParser::Error::column

One-based byte column.

Definition at line 62 of file pjson_parser.h.

◆ line

size_t ByteDance::pJsonParser::Error::line

One-based source line.

Definition at line 61 of file pjson_parser.h.

◆ message

std::string ByteDance::pJsonParser::Error::message

Human-readable diagnostic; wording is not stable. Constructs the successful start-of-input state.

Definition at line 63 of file pjson_parser.h.

◆ offset

size_t ByteDance::pJsonParser::Error::offset

Zero-based input byte offset.

Definition at line 60 of file pjson_parser.h.

◆ ok

bool ByteDance::pJsonParser::Error::ok

True when the most recent parse succeeded.

Definition at line 58 of file pjson_parser.h.


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