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

Structured outcome for the non-throwing serialization APIs. More...

#include <pjson.h>

Public Types

enum  Code {
  None , InvalidUtf8 , NonFiniteNumber , OutputLimit ,
  AllocationFailure , StreamFailure , InternalError
}
 Stable categories for programmatic serialization failure handling. More...
 

Public Member Functions

void reset () noexcept
 Resets the result to success.
 

Public Attributes

Code code
 Stable machine-readable result category.
 
std::string message
 Human-readable diagnostic; empty on success. Constructs a successful serialization result.
 

Detailed Description

Structured outcome for the non-throwing serialization APIs.

Structured result for non-throwing serialization.

Code distinguishes invalid UTF-8, rejected non-finite numbers, output limits, allocation failure, physical stream failure, and unexpected internal errors. String output is transactional; logical stream failures are detected before emission, while a physical sink failure may leave a prefix.

Definition at line 246 of file pjson.h.

Member Enumeration Documentation

◆ Code

Stable categories for programmatic serialization failure handling.

Enumerator
None 

Serialization succeeded.

InvalidUtf8 

A stored string or object key is not valid UTF-8.

NonFiniteNumber 

NaN or infinity was rejected by the active policy.

OutputLimit 

maxOutputBytes or representable output size was exceeded.

AllocationFailure 

Temporary serialization storage could not be allocated.

StreamFailure 

The destination stream rejected a physical write.

InternalError 

An unexpected internal exception was contained.

Definition at line 248 of file pjson.h.

Member Function Documentation

◆ reset()

void ByteDance::pjson::SerializeError::reset ( )
noexcept

Resets the result to success.

Member Data Documentation

◆ code

Code ByteDance::pjson::SerializeError::code

Stable machine-readable result category.

Definition at line 258 of file pjson.h.

◆ message

std::string ByteDance::pjson::SerializeError::message

Human-readable diagnostic; empty on success. Constructs a successful serialization result.

Definition at line 259 of file pjson.h.


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