Kii JSON
 All Classes Files Functions Variables Typedefs Enumerations Enumerator Pages
kii_json.h
Go to the documentation of this file.
1 
5 #ifndef KII_JSON_H
6 #define KII_JSON_H
7 
8 #include <jsmn.h>
9 
10 #ifdef __cplusplus
11 extern "C" {
12 #endif
13 
15 typedef jsmntok_t kii_json_token_t;
16 
20 typedef struct kii_json_resource_t {
21 
23  kii_json_token_t *tokens;
24 
26  size_t tokens_num;
27 
29 
46 typedef int
48  kii_json_resource_t* resource,
49  size_t required_size);
50 
57 typedef struct kii_json_t {
58 
77 
87 
93 
96 } kii_json_t;
97 
99 typedef enum kii_json_boolean_t {
103 
107 
113 
119 
128 
131 
135 
140 
143 
146 
152 
160 
169 
172 typedef enum kii_json_field_type_t {
173 
179 
183 
187 
190 
193 
196 
199 
202 
206 
223 typedef struct kii_json_field_t {
224 
232  const char* name;
233 
279  const char* path;
280 
286 
310 
315  size_t start;
316 
321  size_t end;
322 
329  union {
330 
336  char* string;
337 
345 
352 
359  double double_value;
360 
365  } field_copy;
366 
374 
376 
385  kii_json_t* kii_json,
386  const char* json_string,
387  size_t json_string_len,
388  kii_json_field_t* fields);
389 
390 #ifdef __cplusplus
391 }
392 #endif
393 
394 #endif
Definition: kii_json.h:223
Definition: kii_json.h:192
kii_json_boolean_t
Definition: kii_json.h:99
const char * path
Definition: kii_json.h:279
kii_json_field_parse_result_t result
Definition: kii_json.h:285
size_t start
Definition: kii_json.h:315
Definition: kii_json.h:178
Definition: kii_json.h:139
size_t tokens_num
Definition: kii_json.h:26
const char * name
Definition: kii_json.h:232
Definition: kii_json.h:201
int int_value
Definition: kii_json.h:344
char * error_string_buff
Definition: kii_json.h:92
Definition: kii_json.h:133
Definition: kii_json.h:186
Definition: kii_json.h:127
struct kii_json_field_t kii_json_field_t
kii_json_field_type_t type
Definition: kii_json.h:309
size_t field_copy_buff_size
Definition: kii_json.h:373
kii_json_field_type_t
Definition: kii_json.h:172
Definition: kii_json.h:151
long long_value
Definition: kii_json.h:351
Definition: kii_json.h:182
KII_JSON_RESOURCE_CB resource_cb
Definition: kii_json.h:86
Definition: kii_json.h:159
Definition: kii_json.h:57
struct kii_json_t kii_json_t
kii_json_boolean_t boolean_value
Definition: kii_json.h:364
kii_json_field_parse_result_t
Definition: kii_json.h:137
kii_json_resource_t * resource
Definition: kii_json.h:76
Definition: kii_json.h:145
Definition: kii_json.h:118
Definition: kii_json.h:100
Definition: kii_json.h:198
size_t error_string_length
Definition: kii_json.h:95
kii_json_token_t * tokens
Definition: kii_json.h:23
size_t end
Definition: kii_json.h:321
int(* KII_JSON_RESOURCE_CB)(kii_json_resource_t *resource, size_t required_size)
Definition: kii_json.h:47
Definition: kii_json.h:142
Definition: kii_json.h:167
Definition: kii_json.h:195
Definition: kii_json.h:189
kii_json_parse_result_t
Definition: kii_json.h:106
double double_value
Definition: kii_json.h:359
kii_json_parse_result_t kii_json_read_object(kii_json_t *kii_json, const char *json_string, size_t json_string_len, kii_json_field_t *fields)
Definition: kii_json.h:130
jsmntok_t kii_json_token_t
Definition: kii_json.h:15
Definition: kii_json.h:112
char * string
Definition: kii_json.h:336
Definition: kii_json.h:204
Definition: kii_json.h:101
Definition: kii_json.h:20
union kii_json_field_t::@0 field_copy
struct kii_json_resource_t kii_json_resource_t