Index of values


A
array [Json_type.Build]
builds a JSON Array.
array [Json_type.Browse]
reads a JSON element as a JSON Array and returns an OCaml list, or raises a Json_error exception.

B
bool [Json_type.Build]
builds a JSON Bool
bool [Json_type.Browse]
reads a JSON element as a bool or raises a Json_error exception.

D
describe [Json_type.Browse]
describe x returns a short description of the given JSON data.
deserialize [Json_compat]

F
field [Json_type.Browse]
field tbl key looks for a unique field key in hash table tbl.
fieldx [Json_type.Browse]
fieldx tbl key works like field tbl key, but returns Null if key is not found in the table.
float [Json_type.Build]
builds a JSON Float
float [Json_type.Browse]
reads a JSON element as a float or raises a Json_error exception.

I
int [Json_type.Build]
builds a JSON Int
int [Json_type.Browse]
reads a JSON element as an int or raises a Json_error exception.
is_defined [Json_type.Browse]
tells whether the given JSON element is not null
is_null [Json_type.Browse]
tells whether the given JSON element is null

J
json_of_string [Json_io]
json_of_string s reads the given JSON string.

L
list [Json_type.Build]
list f l maps OCaml list l to a JSON list using function f to convert the elements into JSON values.
list [Json_type.Browse]
list f x maps a JSON Array x to an OCaml list, converting each element of list x using f.
load_json [Json_io]
Same as Json_io.json_of_string but the argument is a file to read from.

M
make_table [Json_type.Browse]
make_table creates a hash table from the contents of a JSON Object.

N
null [Json_type.Build]
The Null value
null [Json_type.Browse]
raises a Json_error exception if the given JSON value is not Null.
number [Json_type.Browse]
reads a JSON element as an int or a float and returns a float or raises a Json_error exception.

O
objekt [Json_type.Build]
builds a JSON Object.
objekt [Json_type.Browse]
reads a JSON element as a JSON Object and returns an OCaml list, or raises a Json_error exception.
optfield [Json_type.Browse]
optfield tbl key queries hash table tbl for zero or one field key.
optfieldx [Json_type.Browse]
optfieldx is the same as optfield except that it will never return Some Null but None instead.
option [Json_type.Build]
option x returns Null is x is None, or y if x is Some y.
option [Json_type.Browse]
option x returns None is x is Null and Some x otherwise.
optional [Json_type.Build]
optional f x returns Null if x is None, or f x otherwise.
optional [Json_type.Browse]
optional f x maps x using the given function f and returns Some result, unless x is Null in which case it returns None.

P
print [Json_io.Pretty]
Generic pretty-printing function.
print [Json_io.Fast]
This function is faster than the one provided by the Json_io.Compact submodule but it is less generic and is subject to the 16MB size limit of strings on 32-bit architectures.
print [Json_io.Compact]
Generic printing function without superfluous space.

S
save_json [Json_io]
save_json works like Json_io.string_of_json but saves the results directly into the file specified by the argument of type string.
serialize [Json_compat]
string [Json_type.Build]
builds a JSON String
string [Json_type.Browse]
reads a JSON element as a string or raises a Json_error exception.
string_of_json [Json_io]
string_of_json converts JSON data to a string.

T
type_mismatch [Json_type.Browse]
type_mismatch expected x raises the Json_error msg exception, where msg is a message that describes the error as a type mismatch between the element x and what is expected.