sig
type json =
[ `Assoc of (string * Yojson.Basic.json) list
| `Bool of bool
| `Float of float
| `Int of int
| `List of Yojson.Basic.json list
| `Null
| `String of string ]
val to_string :
?buf:Bi_outbuf.t -> ?len:int -> ?std:bool -> Yojson.Basic.json -> string
val to_channel :
?buf:Bi_outbuf.t ->
?len:int ->
?std:bool -> Pervasives.out_channel -> Yojson.Basic.json -> unit
val to_output :
?buf:Bi_outbuf.t ->
?len:int ->
?std:bool ->
< output : string -> int -> int -> int; .. > -> Yojson.Basic.json -> unit
val to_file : ?len:int -> ?std:bool -> string -> Yojson.Basic.json -> unit
val to_outbuf : ?std:bool -> Bi_outbuf.t -> Yojson.Basic.json -> unit
val stream_to_string :
?buf:Bi_outbuf.t ->
?len:int -> ?std:bool -> Yojson.Basic.json Stream.t -> string
val stream_to_channel :
?buf:Bi_outbuf.t ->
?len:int ->
?std:bool -> Pervasives.out_channel -> Yojson.Basic.json Stream.t -> unit
val stream_to_file :
?len:int -> ?std:bool -> string -> Yojson.Basic.json Stream.t -> unit
val stream_to_outbuf :
?std:bool -> Bi_outbuf.t -> Yojson.Basic.json Stream.t -> unit
val write_null : Bi_outbuf.t -> unit -> unit
val write_bool : Bi_outbuf.t -> bool -> unit
val write_int : Bi_outbuf.t -> int -> unit
val write_float : Bi_outbuf.t -> float -> unit
val write_std_float : Bi_outbuf.t -> float -> unit
val write_float_fast : Bi_outbuf.t -> float -> unit
val write_std_float_fast : Bi_outbuf.t -> float -> unit
val write_string : Bi_outbuf.t -> string -> unit
val write_assoc : Bi_outbuf.t -> (string * Yojson.Basic.json) list -> unit
val write_list : Bi_outbuf.t -> Yojson.Basic.json list -> unit
val write_json : Bi_outbuf.t -> Yojson.Basic.json -> unit
val write_std_json : Bi_outbuf.t -> Yojson.Basic.json -> unit
val pretty_format : ?std:bool -> Yojson.Basic.json -> Easy_format.t
val pretty_to_string : ?std:bool -> Yojson.Basic.json -> string
val pretty_to_channel :
?std:bool -> Pervasives.out_channel -> Yojson.Basic.json -> unit
val prettify : ?std:bool -> string -> string
val compact : ?std:bool -> string -> string
val from_string :
?buf:Bi_outbuf.t ->
?fname:string -> ?lnum:int -> string -> Yojson.Basic.json
val from_channel :
?buf:Bi_outbuf.t ->
?fname:string -> ?lnum:int -> Pervasives.in_channel -> Yojson.Basic.json
val from_file :
?buf:Bi_outbuf.t ->
?fname:string -> ?lnum:int -> string -> Yojson.Basic.json
type lexer_state =
Yojson.Lexer_state.t = {
buf : Bi_outbuf.t;
mutable lnum : int;
mutable bol : int;
mutable fname : string option;
}
val init_lexer :
?buf:Bi_outbuf.t ->
?fname:string -> ?lnum:int -> unit -> Yojson.Basic.lexer_state
val from_lexbuf :
Yojson.Basic.lexer_state ->
?stream:bool -> Lexing.lexbuf -> Yojson.Basic.json
val stream_from_string :
?buf:Bi_outbuf.t ->
?fname:string -> ?lnum:int -> string -> Yojson.Basic.json Stream.t
val stream_from_channel :
?buf:Bi_outbuf.t ->
?fin:(unit -> unit) ->
?fname:string ->
?lnum:int -> Pervasives.in_channel -> Yojson.Basic.json Stream.t
val stream_from_file :
?buf:Bi_outbuf.t ->
?fname:string -> ?lnum:int -> string -> Yojson.Basic.json Stream.t
val stream_from_lexbuf :
Yojson.Basic.lexer_state ->
?fin:(unit -> unit) -> Lexing.lexbuf -> Yojson.Basic.json Stream.t
type json_line = [ `Exn of exn | `Json of Yojson.Basic.json ]
val linestream_from_channel :
?buf:Bi_outbuf.t ->
?fin:(unit -> unit) ->
?fname:string ->
?lnum:int -> Pervasives.in_channel -> Yojson.Basic.json_line Stream.t
val linestream_from_file :
?buf:Bi_outbuf.t ->
?fname:string -> ?lnum:int -> string -> Yojson.Basic.json_line Stream.t
val finish_string : Yojson.Basic.lexer_state -> Lexing.lexbuf -> string
val read_string : Yojson.Basic.lexer_state -> Lexing.lexbuf -> string
val read_ident : Yojson.Basic.lexer_state -> Lexing.lexbuf -> string
val map_string :
Yojson.Basic.lexer_state ->
(string -> int -> int -> 'a) -> Lexing.lexbuf -> 'a
val map_ident :
Yojson.Basic.lexer_state ->
(string -> int -> int -> 'a) -> Lexing.lexbuf -> 'a
type variant_kind = [ `Double_quote | `Edgy_bracket | `Square_bracket ]
val start_any_variant :
Yojson.Basic.lexer_state -> Lexing.lexbuf -> Yojson.Basic.variant_kind
val finish_variant :
Yojson.Basic.lexer_state -> Lexing.lexbuf -> Yojson.Basic.json option
val finish_skip_variant : Yojson.Basic.lexer_state -> Lexing.lexbuf -> unit
val read_lt : Yojson.Basic.lexer_state -> Lexing.lexbuf -> unit
val read_gt : Yojson.Basic.lexer_state -> Lexing.lexbuf -> unit
val read_comma : Yojson.Basic.lexer_state -> Lexing.lexbuf -> unit
val finish_stringlit : Yojson.Basic.lexer_state -> Lexing.lexbuf -> string
val finish_skip_stringlit :
Yojson.Basic.lexer_state -> Lexing.lexbuf -> unit
val finish_escaped_char : Yojson.Basic.lexer_state -> Lexing.lexbuf -> unit
val finish_comment : Yojson.Basic.lexer_state -> Lexing.lexbuf -> unit
val read_space : Yojson.Basic.lexer_state -> Lexing.lexbuf -> unit
val read_eof : Lexing.lexbuf -> bool
val read_null : Yojson.Basic.lexer_state -> Lexing.lexbuf -> unit
val read_null_if_possible :
Yojson.Basic.lexer_state -> Lexing.lexbuf -> bool
val read_bool : Yojson.Basic.lexer_state -> Lexing.lexbuf -> bool
val read_int : Yojson.Basic.lexer_state -> Lexing.lexbuf -> int
val read_int8 : Yojson.Basic.lexer_state -> Lexing.lexbuf -> char
val read_int32 : Yojson.Basic.lexer_state -> Lexing.lexbuf -> int32
val read_int64 : Yojson.Basic.lexer_state -> Lexing.lexbuf -> int64
val read_number : Yojson.Basic.lexer_state -> Lexing.lexbuf -> float
val skip_ident : Yojson.Basic.lexer_state -> Lexing.lexbuf -> unit
val read_sequence :
('a -> Yojson.Basic.lexer_state -> Lexing.lexbuf -> 'a) ->
'a -> Yojson.Basic.lexer_state -> Lexing.lexbuf -> 'a
val read_list :
(Yojson.Basic.lexer_state -> Lexing.lexbuf -> 'a) ->
Yojson.Basic.lexer_state -> Lexing.lexbuf -> 'a list
val read_list_rev :
(Yojson.Basic.lexer_state -> Lexing.lexbuf -> 'a) ->
Yojson.Basic.lexer_state -> Lexing.lexbuf -> 'a list
val read_array_end : Lexing.lexbuf -> unit
val read_array_sep : Yojson.Basic.lexer_state -> Lexing.lexbuf -> unit
val read_array :
(Yojson.Basic.lexer_state -> Lexing.lexbuf -> 'a) ->
Yojson.Basic.lexer_state -> Lexing.lexbuf -> 'a array
val read_tuple :
(int -> 'a -> Yojson.Basic.lexer_state -> Lexing.lexbuf -> 'a) ->
'a -> Yojson.Basic.lexer_state -> Lexing.lexbuf -> 'a
val start_any_tuple : Yojson.Basic.lexer_state -> Lexing.lexbuf -> bool
val read_lpar : Yojson.Basic.lexer_state -> Lexing.lexbuf -> unit
val read_rpar : Yojson.Basic.lexer_state -> Lexing.lexbuf -> unit
val read_tuple_end : Lexing.lexbuf -> unit
val read_tuple_end2 :
Yojson.Basic.lexer_state -> bool -> Lexing.lexbuf -> unit
val read_tuple_sep : Yojson.Basic.lexer_state -> Lexing.lexbuf -> unit
val read_tuple_sep2 :
Yojson.Basic.lexer_state -> bool -> Lexing.lexbuf -> unit
val read_lbr : Yojson.Basic.lexer_state -> Lexing.lexbuf -> unit
val read_rbr : Yojson.Basic.lexer_state -> Lexing.lexbuf -> unit
val read_fields :
('a -> string -> Yojson.Basic.lexer_state -> Lexing.lexbuf -> 'a) ->
'a -> Yojson.Basic.lexer_state -> Lexing.lexbuf -> 'a
val read_lcurl : Yojson.Basic.lexer_state -> Lexing.lexbuf -> unit
val read_object_end : Lexing.lexbuf -> unit
val read_object_sep : Yojson.Basic.lexer_state -> Lexing.lexbuf -> unit
val read_colon : Yojson.Basic.lexer_state -> Lexing.lexbuf -> unit
val read_json :
Yojson.Basic.lexer_state -> Lexing.lexbuf -> Yojson.Basic.json
val skip_json : Yojson.Basic.lexer_state -> Lexing.lexbuf -> unit
module Util :
sig
exception Type_error of string * Yojson.Basic.json
exception Undefined of string * Yojson.Basic.json
val ( |> ) : 'a -> ('a -> 'b) -> 'b
val member : string -> Yojson.Basic.json -> Yojson.Basic.json
val index : int -> Yojson.Basic.json -> Yojson.Basic.json
val map :
(Yojson.Basic.json -> Yojson.Basic.json) ->
Yojson.Basic.json -> Yojson.Basic.json
val to_assoc : Yojson.Basic.json -> (string * Yojson.Basic.json) list
val to_option :
(Yojson.Basic.json -> 'a) -> Yojson.Basic.json -> 'a option
val to_bool : Yojson.Basic.json -> bool
val to_bool_option : Yojson.Basic.json -> bool option
val to_number : Yojson.Basic.json -> float
val to_number_option : Yojson.Basic.json -> float option
val to_float : Yojson.Basic.json -> float
val to_float_option : Yojson.Basic.json -> float option
val to_int : Yojson.Basic.json -> int
val to_int_option : Yojson.Basic.json -> int option
val to_list : Yojson.Basic.json -> Yojson.Basic.json list
val to_string : Yojson.Basic.json -> string
val to_string_option : Yojson.Basic.json -> string option
val convert_each :
(Yojson.Basic.json -> 'a) -> Yojson.Basic.json -> 'a list
val filter_map : ('a -> 'b option) -> 'a list -> 'b list
val flatten : Yojson.Basic.json list -> Yojson.Basic.json list
val filter_index :
int -> Yojson.Basic.json list -> Yojson.Basic.json list
val filter_list : Yojson.Basic.json list -> Yojson.Basic.json list list
val filter_member :
string -> Yojson.Basic.json list -> Yojson.Basic.json list
val filter_assoc :
Yojson.Basic.json list -> (string * Yojson.Basic.json) list list
val filter_bool : Yojson.Basic.json list -> bool list
val filter_int : Yojson.Basic.json list -> int list
val filter_float : Yojson.Basic.json list -> float list
val filter_number : Yojson.Basic.json list -> float list
val filter_string : Yojson.Basic.json list -> string list
end
end