35 #define json_char char
41 #define json_int_t int64_t
43 #define json_int_t __int64
65 void* (* mem_alloc)(size_t,
int zero,
void*
user_data);
72#define json_enable_comments 0x01
121#if defined(__cplusplus) && __cplusplus >= 201103L
122 decltype(
values) begin()
const
126 decltype(
values) end()
const
139#if defined(__cplusplus) && __cplusplus >= 201103L
140 decltype(
values) begin()
const
144 decltype(
values) end()
const
173 inline const struct _json_value& operator [](
int index)
const
176 || ((
unsigned int) index) >=
u.array.length)
181 return *
u.array.values [index];
184 inline const struct _json_value& operator [](
const char* index)
const
191 for (
unsigned int i = 0; i <
u.object.length; ++ i)
192 if (!strcmp(
u.object.values [i].name, index))
194 return *
u.object.values [i].value;
200 inline operator const char* ()
const
227 inline operator bool ()
const
234 return u.boolean != 0;
237 inline operator double ()
const
242 return (
double)
u.integer;
259#define json_error_max 128
void json_value_free_ex(json_settings *settings, json_value *)
const struct _json_value json_value_none
void json_value_free(json_value *)
struct _json_value json_value
json_value * json_value_find(const json_value *parent, const char *name)
json_value * json_parse(const json_char *json, size_t length)
json_value * json_parse_ex(json_settings *settings, const json_char *json, size_t length, char *error)
json_type
Definition json.h:75
@ json_null
Definition json.h:83
@ json_none
Definition json.h:76
@ json_double
Definition json.h:80
@ json_string
Definition json.h:81
@ json_array
Definition json.h:78
@ json_boolean
Definition json.h:82
@ json_integer
Definition json.h:79
@ json_object
Definition json.h:77
#define json_char
Definition json.h:35
#define json_int_t
Definition json.h:41
unsigned int name_length
Definition json.h:115
struct _json_value::@336351060014303023033354211000104126011371215107::@024110313220144362266052214214012041115126362047 string
json_type type
Definition json.h:93
union _json_value::@336351060014303023033354211000104126011371215107 u
struct _json_value::@336351060014303023033354211000104126011371215107::@175216254025364240255223271310306041217273323145 array
struct _json_value::@336351060014303023033354211000104126011371215107::@241257363143226126026020142046332135067231301222 object
json_int_t integer
Definition json.h:98
unsigned int length
Definition json.h:103
json_char * name
Definition json.h:114
int boolean
Definition json.h:97
struct _json_value * next_alloc
Definition json.h:156
struct _json_value::@336351060014303023033354211000104126011371215107::@241257363143226126026020142046332135067231301222::@123276021266333074365352365172144136021073322172 * values
json_char * ptr
Definition json.h:104
struct _json_value * parent
Definition json.h:91
struct _json_value * value
Definition json.h:117
union _json_value::@126270100163177313313213022312332073142271375123 _reserved
double dbl
Definition json.h:99
void * object_mem
Definition json.h:157
unsigned long max_memory
Definition json.h:59
void * user_data
Definition json.h:68
void(* mem_free)(void *, void *user_data)
Definition json.h:66
int settings
Definition json.h:60