ujson
Complete and simple JSON reader and writer written in C
Data Fields
ujson_val Struct Reference

A parsed JSON key value pair. More...

#include <ujson_reader.h>

Data Fields

enum ujson_type type
 A value type. More...
 
char * buf
 
size_t idx
 An index to attribute list. More...
 
union {
   int   val_bool
 A boolean value.
 
   long long   val_int
 An integer value.
 
   const char *   val_str
 A string value.
 
}; 
 
double val_float
 A floating point value. More...
 
char id [64]
 An ID for object values.
 

Detailed Description

A parsed JSON key value pair.

Definition at line 91 of file ujson_reader.h.

Field Documentation

◆ 

union { ... }

An union to store the parsed value into.

◆ buf

char* ujson_val::buf

An user supplied buffer and size to store a string values to.

Definition at line 100 of file ujson_reader.h.

◆ idx

size_t ujson_val::idx

An index to attribute list.

This is set by the ujson_obj_first_filter() and ujson_obj_next_filter() functions.

Definition at line 109 of file ujson_reader.h.

◆ type

enum ujson_type ujson_val::type

A value type.

UJSON_VALUE_VOID means that no value was parsed.

Definition at line 72 of file ujson_reader.h.

Referenced by ujson_val_valid().

◆ val_float

double ujson_val::val_float

A floating point value.

Since integer values are subset of floating point values val_float is always set when val_int was set.

Definition at line 127 of file ujson_reader.h.


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