Zephyr Project API 4.2.99
A Scalable Open Source RTOS
Loading...
Searching...
No Matches
json_mixed_arr_descr Struct Reference

Descriptor for a mixed-type JSON array. More...

#include <json.h>

Data Fields

uint32_t type: 7
 
size_t count_offset
 
union { 
 
   struct { 
 
      size_t   offset 
 
      size_t   size 
 
   }   primitive 
 
   struct { 
 
      const struct json_obj_descr *   sub_descr 
 
      size_t   sub_descr_len 
 
      size_t   offset 
 
   }   object 
 
   struct { 
 
      const struct json_obj_descr *   element_descr 
 
      size_t   n_elements 
 
      size_t   offset 
 
   }   array 
 
   struct { 
 
      const struct json_mixed_arr_descr *   sub_descr 
 
      size_t   sub_descr_len 
 
      size_t   offset 
 
   }   mixed_array 
 
};  
 

Detailed Description

Descriptor for a mixed-type JSON array.

This structure describes a top-level JSON array whose elements may be of different types (primitives, objects, arrays, or nested mixed arrays). Each element in the array is described by an entry in a descriptor array.

Mixed arrays are useful for parsing and encoding JSON arrays that do not have a homogeneous element type, such as:

[ "string", 42, { "foo": 1 }, [1,2,3], true ]

Note
This structure and its associated macros are intended for use with the mixed array parsing and encoding APIs (see json_mixed_arr_parse()).

Field Documentation

◆ [union]

union { ... } json_mixed_arr_descr

◆ [struct]

struct { ... } json_mixed_arr_descr::array

◆ count_offset

size_t json_mixed_arr_descr::count_offset

◆ element_descr

const struct json_obj_descr* json_mixed_arr_descr::element_descr

◆ [struct]

struct { ... } json_mixed_arr_descr::mixed_array

◆ n_elements

size_t json_mixed_arr_descr::n_elements

◆ [struct]

struct { ... } json_mixed_arr_descr::object

◆ offset

size_t json_mixed_arr_descr::offset

◆ [struct]

struct { ... } json_mixed_arr_descr::primitive

◆ size

size_t json_mixed_arr_descr::size

◆ sub_descr [1/2]

const struct json_obj_descr* json_mixed_arr_descr::sub_descr

◆ sub_descr [2/2]

const struct json_mixed_arr_descr* json_mixed_arr_descr::sub_descr

◆ sub_descr_len

size_t json_mixed_arr_descr::sub_descr_len

◆ type

uint32_t json_mixed_arr_descr::type

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