Legend:
Library
Module
Module type
Parameter
Class
Class type
Strict_stream supports parsing and writing JSON data that conforms to the Json_stream.Strict.json type as a stream of Json_stream.Strict.json objects. This only supports types supported by the JSON standard and explicity excludes integers
The steaming reader provides two interfaces to decode input into a stream of json_stream elements
The internal create_* and decode_stream mechanism
A stream_from_* json_stream Stream.t based approach
Note that the returned stream has no structure thus [1,2,3] will be returned as the stream `Ae, `Int 1, `Int 2, `Int 3, `Ae (assuming basic or extended compliance)
json_stream_of_channel ic creates a stream parser that returns a series of json_stream elements from the in_channelic.
val json_stream_of_function : (bytes ->int -> int)->stream
json_stream_of_function f creates a stream parser that returns a series of json_stream elements from the reader function f. f buf len takes a buffer buf and maximum length len and returns the number of bytes read to a maximum of len
stream_from_function f creates a json_stream Stream.t from json_stream_of_function f and decode_stream
Writer functions
type t
val create_encoder' :
add_char:(char -> unit)->add_string:(string -> unit)->incr:int ->eol:string ->t
create_encoder' ~add_char ~add_string ~incr ~eol is the low level function used to create the various stream encoders. The add_char c and add_string s functions handle adding a charc and strings to the output respectively.
incr and eol work together to output human readable output. incr defines the increase in indentation and eol the end of line sequence. A type t is returned
val create_encoder :
add_char:(char -> unit)->add_string:(string -> unit)->t
create_encoder ~add_char ~add_string creates a compact encoder. add_char and add_string add a char and string to the output respectively A type t is returned
val create_encoder_hum :
add_char:(char -> unit)->add_string:(string -> unit)->t
create_encoder_hum ~add_char ~add_string creates a human readable encoder. add_char and add_string add a char and string to the output respectively. The increment is set to 2 and end of line to LF (\n). A type t is returned