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

Structured JSON Pointer (RFC 6901) lookup failure. More...

#include <pjson.h>

Public Types

enum  Code {
  Ok , InvalidSyntax , InvalidEscape , MissingTarget ,
  ExpectedContainer , InvalidArrayIndex , ArrayIndexOutOfRange , AppendTokenNotAllowed ,
  AllocationFailure , InternalError
}
 Stable categories for programmatic JSON Pointer failure handling. More...
 

Public Attributes

bool ok
 True exactly when code is Ok.
 
Code code
 Stable machine-readable result category.
 
std::string pointer
 Pointer text supplied by the caller.
 
size_t tokenIndex
 Zero-based index of the failing token.
 
std::string token
 Decoded failing token when available.
 
std::string message
 Human-readable diagnostic; wording is not stable. Constructs a successful lookup state with no pointer or token details.
 

Detailed Description

Structured JSON Pointer (RFC 6901) lookup failure.

tokenIndex is zero-based and token is the decoded token that could not be resolved (or the source token when its escape sequence is invalid). std::string reporting overloads reset all fields on entry. A C-string overload can report allocation failure before copying the pointer text.

Definition at line 127 of file pjson.h.

Member Enumeration Documentation

◆ Code

Stable categories for programmatic JSON Pointer failure handling.

Enumerator
Ok 

Lookup succeeded.

InvalidSyntax 

The pointer does not begin with slash or is malformed.

InvalidEscape 

A token contains an invalid tilde escape.

MissingTarget 

An object member or array element does not exist.

ExpectedContainer 

Traversal encountered a scalar before the final token.

InvalidArrayIndex 

An array token is not a canonical non-negative index.

ArrayIndexOutOfRange 

An array token exceeds the current array bounds.

AppendTokenNotAllowed 

The append token is invalid for lookup.

AllocationFailure 

Diagnostic construction could not allocate.

InternalError 

An unexpected internal exception was contained.

Definition at line 129 of file pjson.h.

Member Data Documentation

◆ code

Code ByteDance::pjson::PointerError::code

Stable machine-readable result category.

Definition at line 143 of file pjson.h.

◆ message

std::string ByteDance::pjson::PointerError::message

Human-readable diagnostic; wording is not stable. Constructs a successful lookup state with no pointer or token details.

Definition at line 147 of file pjson.h.

◆ ok

bool ByteDance::pjson::PointerError::ok

True exactly when code is Ok.

Definition at line 142 of file pjson.h.

◆ pointer

std::string ByteDance::pjson::PointerError::pointer

Pointer text supplied by the caller.

Definition at line 144 of file pjson.h.

◆ token

std::string ByteDance::pjson::PointerError::token

Decoded failing token when available.

Definition at line 146 of file pjson.h.

◆ tokenIndex

size_t ByteDance::pjson::PointerError::tokenIndex

Zero-based index of the failing token.

Definition at line 145 of file pjson.h.


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