|
CX Framework
Cross-platform C utility framework
|
Data Structures | |
| struct | SerPathFrame |
| struct | SerTraverseState |
Typedefs | |
| typedef struct SerPathFrame | SerPathFrame |
| typedef struct SerTraverseState | SerTraverseState |
Enumerations | |
| enum | SerCapabilitiesEnum { SER_Cap_NonStringKeys = (1 << 0) , SER_Cap_Bytes = (1 << 1) , SER_Cap_TypeTags = (1 << 2) , SER_Cap_Refs = (1 << 3) , SER_Cap_ExactInt = (1 << 4) , SER_Cap_Skip = (1 << 5) , SER_Cap_Sizes = (1 << 6) } |
| enum | SerFlagsEnum { SER_JSON_Pretty = 0x00000001 , SER_JSON_Compact = 0x00000002 , SER_Bin_Compact = 0x00000100 , SER_Bin_NoStringDedup = 0x00000200 , SER_EmitDefaults = 0x01000000 , SER_Refs = 0x02000000 , SER_Strict = 0x10000000 , SER_Collect = 0x20000000 } |
| Per-document options, passed to a backend's create function. More... | |
| enum | SerErrorCodeEnum { } |
| Error codes reported through SerError::code. More... | |
Functions | |
| void | serPathString (string *out, const SerTraverseState *ws) |
| typedef struct SerPathFrame SerPathFrame |
One frame of the traverser's location within the document.
The traverser pushes a frame per level as it descends and materializes them into SerError::path only when an error is actually raised, so the common path costs a push and a pop and no allocation.
| typedef struct SerTraverseState SerTraverseState |
Traverser state shared by both directions.
Embedded in SerWriter and SerReader alike; the traverser's error and path helpers take a pointer to this rather than to one of the two.
| enum SerCapabilitiesEnum |
What a backend can represent.
A backend advertises these in SerWriter::caps / SerReader::caps so the traverser, and any custom type with its own serialize/deserialize hook, can adapt – for example, writing a byte buffer as raw bytes if SER_Cap_Bytes is set, or as a base64 string otherwise.
| enum SerErrorCodeEnum |
Error codes reported through SerError::code.
| enum SerFlagsEnum |
Per-document options, passed to a backend's create function.
| void serPathString | ( | string * | out, |
| const SerTraverseState * | ws | ||
| ) |
Renders the current path stack as a document path string.
| out | Receives the path, e.g. "/config/servers[3]/port"; "/" at the document root |
| ws | Traverser state to read the path stack from |