Version 7.0
Copyright © 2021 Lowell D. Thomas
APG
… an ABNF Parser Generator
|
Go to the documentation of this file.
42 #include "../utilities/utilities.h"
47 #define JSON_ID_OBJECT 11
49 #define JSON_ID_ARRAY 13
50 #define JSON_ID_STRING 14
51 #define JSON_ID_NUMBER 15
52 #define JSON_ID_TRUE 16
53 #define JSON_ID_FALSE 17
54 #define JSON_ID_NULL 18
61 #define JSON_ID_FLOAT 19
63 #define JSON_ID_SIGNED 20
64 #define JSON_ID_UNSIGNED 21
142 void*
vpJsonFindKeyA(
void *vpCtx,
const char *cpKey, json_value* spValue);
144 void*
vpJsonFindKeyU(
void *vpCtx,
const uint32_t *uipKey,
aint uiLength, json_value* spValue);
145 void*
vpJsonTree(
void* vpCtx, json_value* spValue);
int64_t iSigned
If uiType = JSON_ID_SIGNED, the signed int value.
double dFloat
If uiType = JSON_ID_FLOAT, the floating point value.
u32_phrase * spString
Pointer to the string value if uiId = JSON_ID_STRING.
void vJsonDisplayInput(void *vpCtx, abool bShowLines)
Display the input JSON byte stream.
void * vpJsonReadFile(void *vpCtx, const char *cpFileName)
The JSON file reader.
aint uiJsonBuildMakeTrue(void *vpBuildCtx)
Make a JSON true value.
abool bJsonValidate(void *vpCtx)
Validate a JSON context pointer.
aint uiJsonBuildMakeObject(void *vpBuildCtx)
Make a JSON object value.
The structure of a JSON number value.
aint uiJsonBuildMakeStringA(void *vpBuildCtx, const char *cpString)
Make a string value from a null-terminated ASCII string.
aint uiJsonBuildMakeStringU(void *vpBuildCtx, const uint32_t *uipData, aint uiLength)
Make a string value from UTF-32 code points.
void * vpJsonBuild(void *vpBuildCtx, aint uiRoot)
Build the JSON object.
void vJsonBuildDtor(void *vpBuildCtx)
The builder object destructor.
void * vpJsonCtor(exception *spEx)
The JSON constructor.
aint uiJsonBuildMakeFalse(void *vpBuildCtx)
Make a JSON false value.
void * vpJsonTree(void *vpCtx, json_value *spValue)
Initialize the iterator to walk a value tree.
aint uiJsonBuildMakeArray(void *vpBuildCtx)
Makea JSON array value.
void * vpJsonFindKeyA(void *vpCtx, const char *cpKey, json_value *spValue)
Find JSON values with a specified ASCII key.
uint_fast32_t aint
The APG parser's unsigned integer type.
aint uiId
The type of value. One of.
json_value * spJsonIteratorFirst(void *vpIteratorCtx)
Find the first value in the list represented by this iterator.
json_value * spJsonIteratorPrev(void *vpIteratorCtx)
Find the prev value in the list represented by this iterator.
aint uiJsonBuildMakeNumberU(void *vpBuildCtx, uint64_t uiNumber)
Make a JSON unsigned integer number value.
aint uiJsonBuildAddToObject(void *vpBuildCtx, aint uiObject, aint uiKey, aint uiAdd)
Add a child value to a parent object value.
A structure to describe the type and location of a caught exception.
void * vpJsonFindKeyU(void *vpCtx, const uint32_t *uipKey, aint uiLength, json_value *spValue)
Find JSON values with the specified 32-bit Unicode key.
void * vpJsonBuildCtor(void *vpJsonCtx)
The builder object constructor.
aint uiChildCount
The number of child values if uiId is JSON_ID_OBJECT or JSON_ID_ARRAY.
void vJsonDisplayValue(void *vpCtx, json_value *spValue, aint uiDepth)
Display a value and optionally the values in the branch below, if any.
json_number * spNumber
Pointer to the number value if uiId = JSON_ID_NUMBER.
aint uiJsonIteratorCount(void *vpIteratorCtx)
Find the number of values in the list represented by this iterator.
void * vpJsonReadArray(void *vpCtx, uint8_t *ucpData, aint uiDataLen)
The JSON array reader.
void vJsonDtor(void *vpCtx)
The JSON Parser component destructor.
json_value * spJsonIteratorNext(void *vpIteratorCtx)
Find the next value in the list represented by this iterator.
u32_phrase * spKey
Points to the associated key string if this is a member of a JSON object. Otherwise,...
uint8_t * ucpJsonWrite(void *vpCtx, json_value *spValue, aint *uipCount)
Converts a sub-tree of values into UTF-8 byte stream of JSON text.
uint64_t uiUnsigned
If uiType = JSON_ID_UNSIGNED, the unsigned int value.
uint8_t abool
abool is the APG bool type.
void vJsonBuildClear(void *vpBuildCtx)
Clears all memory associated with this builder object.
void vJsonIteratorDtor(void *vpIteratorCtx)
The JSON iterator destructor.
void * vpJsonChildren(void *vpCtx, json_value *spValue)
Initialize the iterator over the children of the given value as the parent node.
struct json_value_tag ** sppChildren
Points to a list of child value pointers if uiId is JSON_ID_OBJECT or JSON_ID_ARRAY.
aint uiType
Identifies the number type. One of.
Defines a pointer to an array of 32-bit unsigned integers plus its length. Typically needed by Unicod...
The structure of a JSON value.
aint uiJsonBuildMakeNumberF(void *vpBuildCtx, double dNumber)
Make a JSON floating point number value.
aint uiJsonBuildMakeNumberS(void *vpBuildCtx, int64_t iNumber)
Make a JSON signed integer number value.
aint uiJsonBuildMakeNull(void *vpBuildCtx)
Make a JSON null value.
json_value * spJsonIteratorLast(void *vpIteratorCtx)
Find the last value in the list represented by this iterator.
aint uiJsonBuildAddToArray(void *vpBuildCtx, aint uiArray, aint uiAdd)
Add a child value to a parent array value.
APG Version 7.0 is licensed under the
2-Clause BSD License,
an Open Source Initiative Approved License.