Version 7.0
Copyright © 2021 Lowell D. Thomas
APG
… an ABNF Parser Generator
Data Fields
json_value_tag Struct Reference

The structure of a JSON value. More...

#include <json.h>

Collaboration diagram for json_value_tag:
Collaboration graph
[legend]

Data Fields

aint uiId
 The type of value. One of. More...
 
u32_phrasespKey
 Points to the associated key string if this is a member of a JSON object. Otherwise, NULL. More...
 
union {
   u32_phrase *   spString
 Pointer to the string value if uiId = JSON_ID_STRING. More...
 
   json_number *   spNumber
 Pointer to the number value if uiId = JSON_ID_NUMBER. More...
 
   struct {
      struct json_value_tag **   sppChildren
 Points to a list of child value pointers if uiId is JSON_ID_OBJECT or JSON_ID_ARRAY. More...
 
      aint   uiChildCount
 The number of child values if uiId is JSON_ID_OBJECT or JSON_ID_ARRAY. More...
 
   } 
 
}; 
 

Detailed Description

The structure of a JSON value.

The json specification defines seven different value types – object, array, string, number, true, false and null. This APG JSON parser equalizes the handling of them all with this structure/union. Any one of these value types can be represented with this structure, including object members, which are treated as values with the addition of a key string.

Definition at line 99 of file json.h.

Field Documentation

◆ @9

union { ... }

◆ spKey

u32_phrase* json_value_tag::spKey

Points to the associated key string if this is a member of a JSON object. Otherwise, NULL.

Definition at line 108 of file json.h.

◆ spNumber

json_number* json_value_tag::spNumber

Pointer to the number value if uiId = JSON_ID_NUMBER.

Definition at line 111 of file json.h.

◆ sppChildren

struct json_value_tag** json_value_tag::sppChildren

Points to a list of child value pointers if uiId is JSON_ID_OBJECT or JSON_ID_ARRAY.

Definition at line 113 of file json.h.

◆ spString

u32_phrase* json_value_tag::spString

Pointer to the string value if uiId = JSON_ID_STRING.

Definition at line 110 of file json.h.

◆ uiChildCount

aint json_value_tag::uiChildCount

The number of child values if uiId is JSON_ID_OBJECT or JSON_ID_ARRAY.

Definition at line 115 of file json.h.

◆ uiId

aint json_value_tag::uiId

The type of value. One of.

  • JSON_ID_OBJECT
  • JSON_ID_ARRAY
  • JSON_ID_STRING
  • JSON_ID_NUMBER
  • JSON_ID_TRUE
  • JSON_ID_FALSE
  • JSON_ID_NULL,

Definition at line 100 of file json.h.


The documentation for this struct was generated from the following file:
APG Version 7.0 is licensed under the 2-Clause BSD License,
an Open Source Initiative Approved License.