11#include <cx/struct/struct.h>
72 _Inout_opt_
void* user);
74typedef struct SerResolverEnt {
83_Ret_maybenull_ strref _serBuiltinName(uint32 stypeid);
84bool _serResolveBuiltin(_Out_
SerResolved* out, _In_opt_ strref name);
187typedef struct SerError {
194void serErrorDestroy(_Inout_ SerError* err);
SerErrorCodeEnum
Error codes reported through SerError::code.
void serPathString(string *out, const SerTraverseState *ws)
SerFlagsEnum
Per-document options, passed to a backend's create function.
@ SER_Err_Type
a type cannot be serialized, or is not what the schema said
@ SER_Err_Backend
the backend refused or failed to emit/consume a node
@ SER_Err_Unsupported
the backend lacks a capability this value needs
@ SER_Err_Schema
the schema is missing or malformed where one is required
@ SER_Err_Data
the data does not match what the schema expects
@ SER_Err_Overflow
a value does not fit the slot it is being read into
@ SER_Cap_Sizes
container counts are known before their contents
@ SER_Cap_TypeTags
type annotations are preserved
@ SER_Cap_ExactInt
the full int64/uint64 range round-trips exactly
@ SER_Cap_Skip
the reader can skip over an unknown value
@ SER_Cap_Bytes
native binary blob node
@ SER_Cap_Refs
SER_RefDef / SER_RefUse are honored.
@ SER_Cap_NonStringKeys
maps may be keyed by arbitrary values
@ SER_JSON_Compact
single line
@ SER_Bin_NoStringDedup
inline string values
@ SER_EmitDefaults
write members equal to their default
@ SER_Refs
enable reference dedup where supported
@ SER_Strict
unknown fields and lossy cases are errors
@ SER_JSON_Pretty
4-space indent
@ SER_Bin_Compact
omit type tags
bool(* SerTypeResolver)(SerResolved *out, strref name, void *user)
enum SerNodeKindEnum SerNodeKind
bool serClassSetResolver(SerResolved *out, strref name, void *user)
bool serObjClassResolver(SerResolved *out, strref name, void *user)
bool serStructSetResolver(SerResolved *out, strref name, void *user)
@ SER_TypeTag
a type annotation preceding a value
@ SER_EOF
reader is positioned past the end of the document
@ SER_ArrayBegin
start of an ordered sequence
@ SER_RefUse
stands in for a value already written under an id
@ SER_Bytes
opaque byte run
@ SER_Real
float64 plus the declared stype
@ SER_MapKey
a key; a string, or a typed value where supported
@ SER_Invalid
not a node; returned by peek when the reader is in an error state
@ SER_Int
int64 plus the declared stype
@ SER_Uint
uint64 plus the declared stype
@ SER_MapBegin
start of a keyed collection
@ SER_RefDef
defines an id for the value that follows
Dynamic arrays with type-safe generic programming.
Copy-on-write strings with automatic memory management and rope optimization.
strref name
member or map key; NULL for an array index frame
int32 idx
array index, when name is NULL
const StructInfo * structinfo
struct / structp, else NULL
ObjClassInfo * clsinfo
object class, else NULL
stype type
runtime descriptor
sa_SerError collected
SER_Collect only.
sa_SerPathFrame path
current location, innermost last
Runtime type system and type descriptor infrastructure.