#include <stdio.h>
#include "json_object.h"
Go to the source code of this file.
Defines | |
#define | jo_add json_object_object_add |
#define | jo_array_add json_object_array_add |
#define | jo_array_get json_object_array_get_idx |
#define | jo_array_length json_object_array_length |
#define | jo_del json_object_object_del |
#define | jo_free json_object_put |
#define | jo_get json_object_object_get |
#define | jo_get_string json_object_get_string |
#define | jo_new json_object_new_object |
#define | jo_new_array json_object_new_array |
#define | jo_new_double json_object_new_double |
#define | jo_new_int json_object_new_int |
#define | jo_new_null() 0 |
#define | jo_new_string json_object_new_string |
#define | jo_to_string json_write |
Typedefs | |
typedef struct json_object * | JO |
Functions | |
void | jo_add_double (JO parent, const char *name, double v) |
void | jo_add_double_array (JO parent, const char *name, const double *v, int n) |
void | jo_add_int (JO parent, const char *name, int v) |
void | jo_add_int_array (JO parent, const char *name, const int *v, int n) |
void | jo_add_string (JO parent, const char *name, const char *v) |
JO | jo_double_or_null (double d) |
int | jo_has_field (JO s, const char *name) |
JO | jo_new_double_array (const double *v, int n) |
JO | jo_new_int_array (const int *v, int n) |
int | jo_read_double (JO parent, const char *name, double *p) |
int | jo_read_double_array (JO parent, const char *name, double *p, int n, double when_null) |
int | jo_read_from_double_array (JO array, double *p, int n, double when_null) |
int | jo_read_int (JO parent, const char *name, int *p) |
int | jo_read_int_array (JO parent, const char *name, int *p, int n, int when_null) |
int | jo_read_string (JO parent, const char *name, char *v, size_t max_len) |
JO | json_parse (const char *str) |
JO | json_read_stream (FILE *) |
int | json_stream_skip (FILE *) |
int | json_to_double (JO jo, double *ptr) |
int | json_to_int (JO jo, int *ptr) |
JO | json_tokener_parse_len (const char *str, int len) |
const char * | json_write (JO jo) |
#define jo_add json_object_object_add |
Definition at line 14 of file json_more_utils.h.
#define jo_array_add json_object_array_add |
Definition at line 19 of file json_more_utils.h.
#define jo_array_get json_object_array_get_idx |
Definition at line 20 of file json_more_utils.h.
#define jo_array_length json_object_array_length |
Definition at line 21 of file json_more_utils.h.
#define jo_del json_object_object_del |
Definition at line 15 of file json_more_utils.h.
#define jo_free json_object_put |
Definition at line 16 of file json_more_utils.h.
#define jo_get json_object_object_get |
Definition at line 17 of file json_more_utils.h.
#define jo_get_string json_object_get_string |
Definition at line 22 of file json_more_utils.h.
#define jo_new json_object_new_object |
Definition at line 18 of file json_more_utils.h.
#define jo_new_array json_object_new_array |
Definition at line 11 of file json_more_utils.h.
#define jo_new_double json_object_new_double |
Definition at line 9 of file json_more_utils.h.
#define jo_new_int json_object_new_int |
Definition at line 10 of file json_more_utils.h.
#define jo_new_null | ( | ) | 0 |
Definition at line 13 of file json_more_utils.h.
#define jo_new_string json_object_new_string |
Definition at line 12 of file json_more_utils.h.
#define jo_to_string json_write |
Definition at line 75 of file json_more_utils.h.
typedef struct json_object* JO |
Definition at line 7 of file json_more_utils.h.
void jo_add_double | ( | JO | parent, | |
const char * | name, | |||
double | v | |||
) |
void jo_add_double_array | ( | JO | parent, | |
const char * | name, | |||
const double * | v, | |||
int | n | |||
) |
void jo_add_int | ( | JO | parent, | |
const char * | name, | |||
int | v | |||
) |
void jo_add_int_array | ( | JO | parent, | |
const char * | name, | |||
const int * | v, | |||
int | n | |||
) |
void jo_add_string | ( | JO | parent, | |
const char * | name, | |||
const char * | v | |||
) |
JO jo_double_or_null | ( | double | d | ) |
int jo_has_field | ( | JO | s, | |
const char * | name | |||
) |
Return true if there is a field
JO jo_new_double_array | ( | const double * | v, | |
int | n | |||
) |
JO jo_new_int_array | ( | const int * | v, | |
int | n | |||
) |
int jo_read_double | ( | JO | parent, | |
const char * | name, | |||
double * | p | |||
) |
This also tolerates an integer
int jo_read_double_array | ( | JO | parent, | |
const char * | name, | |||
double * | p, | |||
int | n, | |||
double | when_null | |||
) |
int jo_read_from_double_array | ( | JO | array, | |
double * | p, | |||
int | n, | |||
double | when_null | |||
) |
int jo_read_int | ( | JO | parent, | |
const char * | name, | |||
int * | p | |||
) |
Return 0 if there isn't a field called 'name'
int jo_read_int_array | ( | JO | parent, | |
const char * | name, | |||
int * | p, | |||
int | n, | |||
int | when_null | |||
) |
int jo_read_string | ( | JO | parent, | |
const char * | name, | |||
char * | v, | |||
size_t | max_len | |||
) |
JO json_parse | ( | const char * | str | ) |
JO json_read_stream | ( | FILE * | ) |
Reads a JSON object from stream. Returns 0 on error. XXX: does not support unicode.
int json_stream_skip | ( | FILE * | ) |
Skips one object from stream (without parsing it). Returns 0 on error. XXX: does not support unicode.
int json_to_double | ( | JO | jo, | |
double * | ptr | |||
) |
Converts an integer or a double to a double, or else *ptr will be set to NAN.
int json_to_int | ( | JO | jo, | |
int * | ptr | |||
) |
JO json_tokener_parse_len | ( | const char * | str, | |
int | len | |||
) |
const char* json_write | ( | JO | jo | ) |