diff --git a/index.html b/index.html index 0a12e78..5c79edc 100644 --- a/index.html +++ b/index.html @@ -11,8 +11,8 @@
Yojson_five.Ast
val to_basic :
- t ->
- [> `Assoc of (string * 'a) list
- | `Bool of bool
- | `Float of float
- | `Int of int
- | `List of 'a list
- | `Null
- | `String of string ] as 'a
val to_safe :
- t ->
- [> `Assoc of (string * 'a) list
- | `Bool of bool
- | `Float of float
- | `Int of int
- | `Intlit of string
- | `List of 'a list
- | `Null
- | `String of string ] as 'a
Yojson_five.Basic
include module type of struct include Yojson.Basic end
val to_string :
+Basic (yojson-five.Yojson_five.Basic) Module Yojson_five.Basic
type t = Yojson.Basic.t
val from_string :
+ ?fname:string ->
+ ?lnum:int ->
+ string ->
+ (t, string) Stdlib.result
val from_channel :
+ ?fname:string ->
+ ?lnum:int ->
+ Stdlib.in_channel ->
+ (t, string) Stdlib.result
val from_file :
+ ?fname:string ->
+ ?lnum:int ->
+ string ->
+ (t, string) Stdlib.result
Write a compact JSON value to a string.
val to_channel :
+ t ->
+ string
val to_channel :
?buf:Stdlib.Buffer.t ->
?len:int ->
?suf:string ->
?std:bool ->
Stdlib.out_channel ->
- {t}1 ->
- unit
Write a compact JSON value to a channel. Note: the out_channel
is not flushed by this function.
See to_string
for the role of the optional arguments and raised exceptions.
val to_output :
- ?buf:Stdlib.Buffer.t ->
- ?len:int ->
- ?suf:string ->
- ?std:bool ->
- < output : string -> int -> int -> int.. > ->
- {t}1 ->
- unit
Write a compact JSON value to an OO channel.
See to_string
for the role of the optional arguments and raised exceptions.
Write a compact JSON value to a file. See to_string
for the role of the optional arguments and raised exceptions.
Write a compact JSON value to an existing buffer. See to_string
for the role of the optional argument and raised exceptions.
val seq_to_string :
+ t ->
+ unit
val to_output :
?buf:Stdlib.Buffer.t ->
?len:int ->
?suf:string ->
?std:bool ->
- {t}1 Stdlib.Seq.t ->
- string
Write a sequence of suf
-suffixed compact one-line JSON values to a string.
val seq_to_channel :
- ?buf:Stdlib.Buffer.t ->
- ?len:int ->
- ?suf:string ->
- ?std:bool ->
- Stdlib.out_channel ->
- {t}1 Stdlib.Seq.t ->
- unit
Write a sequence of suf
-suffixed compact one-line JSON values to a channel.
val seq_to_file :
- ?len:int ->
- ?suf:string ->
- ?std:bool ->
- string ->
- {t}1 Stdlib.Seq.t ->
- unit
Write a sequence of suf
-suffixed compact one-line JSON values to a file.
val seq_to_buffer :
- ?suf:string ->
- ?std:bool ->
- Stdlib.Buffer.t ->
- {t}1 Stdlib.Seq.t ->
- unit
Write a sequence of suf
-suffixed compact one-line JSON values to an existing buffer.
Write the given JSON value to the given buffer. Provided as a writer function for atdgen.
Miscellaneous
Sort object fields (stable sort, comparing field names and treating them as byte sequences)
equal a b
is the monomorphic equality. Determines whether two JSON values are considered equal. In the case of JSON objects, the order of the keys does not matter, except for duplicate keys which will be considered equal as long as they are in the same input order.
JSON pretty-printing
Pretty-print into a Format
.formatter. See to_string
for the role of the optional std
argument.
Pretty-print into a string. See to_string
for the role of the optional std
argument. See pretty_print
for raised exceptions.
Pretty-print to a channel. See to_string
for the role of the optional std
argument. See pretty_print
for raised exceptions.
Combined parser and pretty-printer. See to_string
for the role of the optional std
argument and raised exceptions.
Combined parser and printer. See to_string
for the role of the optional std
argument and raised exceptions.
JSON readers
This alias is provided for backward compatibility. New code should refer to Yojson.lexer_state
directly.
val init_lexer :
- ?buf:Stdlib.Buffer.t ->
- ?fname:string ->
- ?lnum:int ->
- unit ->
- lexer_state
This alias is provided for backward compatibility. New code should use Yojson.init_lexer
directly.
val from_lexbuf : lexer_state -> ?stream:bool -> Stdlib.Lexing.lexbuf -> {t}1
Read a JSON value from a lexbuf. A valid initial lexer_state
can be created with init_lexer
. See from_string
for the meaning of the optional arguments and raised exceptions.
val seq_from_string :
- ?buf:Stdlib.Buffer.t ->
- ?fname:string ->
- ?lnum:int ->
- string ->
- {t}1 Stdlib.Seq.t
Input a sequence of JSON values from a string. Whitespace between JSON values is fine but not required. See from_string
for the meaning of the optional arguments and raised exceptions.
val seq_from_channel :
- ?buf:Stdlib.Buffer.t ->
- ?fin:(unit -> unit) ->
- ?fname:string ->
- ?lnum:int ->
- Stdlib.in_channel ->
- {t}1 Stdlib.Seq.t
Input a sequence of JSON values from a channel. Whitespace between JSON values is fine but not required.
val seq_from_file :
- ?buf:Stdlib.Buffer.t ->
- ?fname:string ->
- ?lnum:int ->
- string ->
- {t}1 Stdlib.Seq.t
Input a sequence of JSON values from a file. Whitespace between JSON values is fine but not required.
See from_string
for the meaning of the optional arguments and raised exceptions.
val seq_from_lexbuf :
- lexer_state ->
- ?fin:(unit -> unit) ->
- Stdlib.Lexing.lexbuf ->
- {t}1 Stdlib.Seq.t
Input a sequence of JSON values from a lexbuf. A valid initial lexer_state
can be created with init_lexer
. Whitespace between JSON values is fine but not required.
The type of values resulting from a parsing attempt of a JSON value.
val lineseq_from_channel :
- ?buf:Stdlib.Buffer.t ->
- ?fin:(unit -> unit) ->
- ?fname:string ->
- ?lnum:int ->
- Stdlib.in_channel ->
- json_line Stdlib.Seq.t
Input a sequence of JSON values, one per line, from a channel. Exceptions raised when reading malformed lines are caught and represented using `Exn
.
See seq_from_channel
for the meaning of the optional fin
argument. See from_string
for the meaning of the other optional arguments and raised exceptions.
val lineseq_from_file :
- ?buf:Stdlib.Buffer.t ->
- ?fname:string ->
- ?lnum:int ->
- string ->
- json_line Stdlib.Seq.t
Input a sequence of JSON values, one per line, from a file. Exceptions raised when reading malformed lines are caught and represented using `Exn
.
See seq_from_channel
for the meaning of the optional fin
argument. See from_string
for the meaning of the other optional arguments and raised exceptions.
val read_t : lexer_state -> Stdlib.Lexing.lexbuf -> {t}1
Read a JSON value from the given lexer_state and lexing buffer and return it. Provided as a reader function for atdgen.
module Util = Yojson.Basic.Util
This module provides combinators for extracting fields from JSON values.
include sig ... end
type t = Yojson.Basic.t
val from_string :
- ?fname:string ->
- ?lnum:int ->
- string ->
- (t, string) Stdlib.result
val from_channel :
- ?fname:string ->
- ?lnum:int ->
- Stdlib.in_channel ->
- (t, string) Stdlib.result
val from_file :
- ?fname:string ->
- ?lnum:int ->
- string ->
- (t, string) Stdlib.result
val to_file : ?len:int -> ?std:bool -> ?suf:string -> string -> t -> unit
val pp : Stdlib.Format.formatter -> t -> unit
Let_syntax.Result
Yojson_five.Let_syntax
module Result : sig ... end
Yojson_five.Lexer
val pp_token : Stdlib.Format.formatter -> token -> unit
Yojson_five.Parser
val parse_list :
- Ast.t list ->
- Lexer.token list ->
- (Ast.t list * Lexer.token list, string) Stdlib.result
val parse_assoc :
- (string * Ast.t) list ->
- Lexer.token list ->
- ((string * Ast.t) list * Lexer.token list, string) Stdlib.result
val parse :
- Lexer.token list ->
- (Ast.t * Lexer.token list, string) Stdlib.result
val parse_from_lexbuf :
- ?fname:string ->
- ?lnum:int ->
- Sedlexing.lexbuf ->
- (Ast.t, string) Stdlib.result
val parse_from_string :
- ?fname:string ->
- ?lnum:int ->
- string ->
- (Ast.t, string) Stdlib.result
val parse_from_channel :
- ?fname:string ->
- ?lnum:int ->
- Stdlib.in_channel ->
- (Ast.t, string) Stdlib.result
val parse_from_file :
- ?fname:string ->
- ?lnum:int ->
- string ->
- (Ast.t, string) Stdlib.result
Make.F
Read.Make
type t = F.t
val from_string :
- ?fname:string ->
- ?lnum:int ->
- string ->
- (t, string) Stdlib.result
val from_channel :
- ?fname:string ->
- ?lnum:int ->
- Stdlib.in_channel ->
- (t, string) Stdlib.result
val from_file :
- ?fname:string ->
- ?lnum:int ->
- string ->
- (t, string) Stdlib.result
Yojson_five.Read
Read.Out
val from_string :
- ?fname:string ->
- ?lnum:int ->
- string ->
- (t, string) Stdlib.result
val from_channel :
- ?fname:string ->
- ?lnum:int ->
- Stdlib.in_channel ->
- (t, string) Stdlib.result
val from_file :
- ?fname:string ->
- ?lnum:int ->
- string ->
- (t, string) Stdlib.result
Read.S
Yojson_five.Safe
include module type of struct include Yojson.Safe end
equal a b
is the monomorphic equality. Determines whether two JSON values are considered equal. In the case of JSON objects, the order of the keys does not matter, except for duplicate keys which will be considered equal as long as they are in the same input order.
val to_basic : {t}2 -> Yojson.Basic.t
Tuples are converted to JSON arrays, Variants are converted to JSON strings or arrays of a string (constructor) and a json value (argument). Long integers are converted to JSON strings.
Examples:
`Tuple [ `Int 1; `Float 2.3 ] -> `List [ `Int 1; `Float 2.3 ] -`Variant ("A", None) -> `String "A" -`Variant ("B", Some x) -> `List [ `String "B", x ] -`Intlit "12345678901234567890" -> `String "12345678901234567890"
val to_string :
+Safe (yojson-five.Yojson_five.Safe) Module Yojson_five.Safe
type t = Yojson.Safe.t
val from_string :
+ ?fname:string ->
+ ?lnum:int ->
+ string ->
+ (t, string) Stdlib.result
val from_channel :
+ ?fname:string ->
+ ?lnum:int ->
+ Stdlib.in_channel ->
+ (t, string) Stdlib.result
val from_file :
+ ?fname:string ->
+ ?lnum:int ->
+ string ->
+ (t, string) Stdlib.result
Write a compact JSON value to a string.
val to_channel :
+ t ->
+ string
val to_channel :
?buf:Stdlib.Buffer.t ->
?len:int ->
?suf:string ->
?std:bool ->
Stdlib.out_channel ->
- {t}2 ->
- unit
Write a compact JSON value to a channel. Note: the out_channel
is not flushed by this function.
See to_string
for the role of the optional arguments and raised exceptions.
val to_output :
- ?buf:Stdlib.Buffer.t ->
- ?len:int ->
- ?suf:string ->
- ?std:bool ->
- < output : string -> int -> int -> int.. > ->
- {t}2 ->
- unit
Write a compact JSON value to an OO channel.
See to_string
for the role of the optional arguments and raised exceptions.
Write a compact JSON value to a file. See to_string
for the role of the optional arguments and raised exceptions.
Write a compact JSON value to an existing buffer. See to_string
for the role of the optional argument and raised exceptions.
val seq_to_string :
+ t ->
+ unit
val to_output :
?buf:Stdlib.Buffer.t ->
?len:int ->
?suf:string ->
?std:bool ->
- {t}2 Stdlib.Seq.t ->
- string
Write a sequence of suf
-suffixed compact one-line JSON values to a string.
val seq_to_channel :
- ?buf:Stdlib.Buffer.t ->
- ?len:int ->
- ?suf:string ->
- ?std:bool ->
- Stdlib.out_channel ->
- {t}2 Stdlib.Seq.t ->
- unit
Write a sequence of suf
-suffixed compact one-line JSON values to a channel.
val seq_to_file :
- ?len:int ->
- ?suf:string ->
- ?std:bool ->
- string ->
- {t}2 Stdlib.Seq.t ->
- unit
Write a sequence of suf
-suffixed compact one-line JSON values to a file.
val seq_to_buffer :
- ?suf:string ->
- ?std:bool ->
- Stdlib.Buffer.t ->
- {t}2 Stdlib.Seq.t ->
- unit
Write a sequence of suf
-suffixed compact one-line JSON values to an existing buffer.
Write the given JSON value to the given buffer. Provided as a writer function for atdgen.
Miscellaneous
Sort object fields (stable sort, comparing field names and treating them as byte sequences)
JSON pretty-printing
Pretty-print into a Format
.formatter. See to_string
for the role of the optional std
argument.
Pretty-print into a string. See to_string
for the role of the optional std
argument. See pretty_print
for raised exceptions.
Pretty-print to a channel. See to_string
for the role of the optional std
argument. See pretty_print
for raised exceptions.
Combined parser and pretty-printer. See to_string
for the role of the optional std
argument and raised exceptions.
Combined parser and printer. See to_string
for the role of the optional std
argument and raised exceptions.
JSON readers
This alias is provided for backward compatibility. New code should refer to Yojson.lexer_state
directly.
val init_lexer :
- ?buf:Stdlib.Buffer.t ->
- ?fname:string ->
- ?lnum:int ->
- unit ->
- lexer_state
This alias is provided for backward compatibility. New code should use Yojson.init_lexer
directly.
val from_lexbuf : lexer_state -> ?stream:bool -> Stdlib.Lexing.lexbuf -> {t}2
Read a JSON value from a lexbuf. A valid initial lexer_state
can be created with init_lexer
. See from_string
for the meaning of the optional arguments and raised exceptions.
val seq_from_string :
- ?buf:Stdlib.Buffer.t ->
- ?fname:string ->
- ?lnum:int ->
- string ->
- {t}2 Stdlib.Seq.t
Input a sequence of JSON values from a string. Whitespace between JSON values is fine but not required. See from_string
for the meaning of the optional arguments and raised exceptions.
val seq_from_channel :
- ?buf:Stdlib.Buffer.t ->
- ?fin:(unit -> unit) ->
- ?fname:string ->
- ?lnum:int ->
- Stdlib.in_channel ->
- {t}2 Stdlib.Seq.t
Input a sequence of JSON values from a channel. Whitespace between JSON values is fine but not required.
val seq_from_file :
- ?buf:Stdlib.Buffer.t ->
- ?fname:string ->
- ?lnum:int ->
- string ->
- {t}2 Stdlib.Seq.t
Input a sequence of JSON values from a file. Whitespace between JSON values is fine but not required.
See from_string
for the meaning of the optional arguments and raised exceptions.
val seq_from_lexbuf :
- lexer_state ->
- ?fin:(unit -> unit) ->
- Stdlib.Lexing.lexbuf ->
- {t}2 Stdlib.Seq.t
Input a sequence of JSON values from a lexbuf. A valid initial lexer_state
can be created with init_lexer
. Whitespace between JSON values is fine but not required.
The type of values resulting from a parsing attempt of a JSON value.
val lineseq_from_channel :
- ?buf:Stdlib.Buffer.t ->
- ?fin:(unit -> unit) ->
- ?fname:string ->
- ?lnum:int ->
- Stdlib.in_channel ->
- json_line Stdlib.Seq.t
Input a sequence of JSON values, one per line, from a channel. Exceptions raised when reading malformed lines are caught and represented using `Exn
.
See seq_from_channel
for the meaning of the optional fin
argument. See from_string
for the meaning of the other optional arguments and raised exceptions.
val lineseq_from_file :
- ?buf:Stdlib.Buffer.t ->
- ?fname:string ->
- ?lnum:int ->
- string ->
- json_line Stdlib.Seq.t
Input a sequence of JSON values, one per line, from a file. Exceptions raised when reading malformed lines are caught and represented using `Exn
.
See seq_from_channel
for the meaning of the optional fin
argument. See from_string
for the meaning of the other optional arguments and raised exceptions.
val read_t : lexer_state -> Stdlib.Lexing.lexbuf -> {t}2
Read a JSON value from the given lexer_state and lexing buffer and return it. Provided as a reader function for atdgen.
module Util = Yojson.Safe.Util
This module provides combinators for extracting fields from JSON values.
include sig ... end
type t = Yojson.Safe.t
val from_string :
- ?fname:string ->
- ?lnum:int ->
- string ->
- (t, string) Stdlib.result
val from_channel :
- ?fname:string ->
- ?lnum:int ->
- Stdlib.in_channel ->
- (t, string) Stdlib.result
val from_file :
- ?fname:string ->
- ?lnum:int ->
- string ->
- (t, string) Stdlib.result
val to_file : ?len:int -> ?std:bool -> ?suf:string -> string -> t -> unit
val pp : Stdlib.Format.formatter -> t -> unit
Yojson_five.Unescape
Yojson_json5.Basic
type t = Yojson.Basic.t
val from_string :
- ?fname:string ->
- ?lnum:int ->
- string ->
- (t, string) Stdlib.result
val from_channel :
- ?fname:string ->
- ?lnum:int ->
- Stdlib.in_channel ->
- (t, string) Stdlib.result
val from_file :
- ?fname:string ->
- ?lnum:int ->
- string ->
- (t, string) Stdlib.result
val to_string :
- ?buf:Stdlib.Buffer.t ->
- ?len:int ->
- ?suf:string ->
- ?std:bool ->
- t ->
- string
val to_channel :
- ?buf:Stdlib.Buffer.t ->
- ?len:int ->
- ?suf:string ->
- ?std:bool ->
- Stdlib.out_channel ->
- t ->
- unit
val to_output :
- ?buf:Stdlib.Buffer.t ->
- ?len:int ->
- ?suf:string ->
- ?std:bool ->
- < output : string -> int -> int -> int > ->
- t ->
- unit
val to_file : ?len:int -> ?std:bool -> ?suf:string -> string -> t -> unit
val pp : Stdlib.Format.formatter -> t -> unit
Yojson_json5.Safe
type t = Yojson.Safe.t
val from_string :
- ?fname:string ->
- ?lnum:int ->
- string ->
- (t, string) Stdlib.result
val from_channel :
- ?fname:string ->
- ?lnum:int ->
- Stdlib.in_channel ->
- (t, string) Stdlib.result
val from_file :
- ?fname:string ->
- ?lnum:int ->
- string ->
- (t, string) Stdlib.result
val to_string :
- ?buf:Stdlib.Buffer.t ->
- ?len:int ->
- ?suf:string ->
- ?std:bool ->
- t ->
- string
val to_channel :
- ?buf:Stdlib.Buffer.t ->
- ?len:int ->
- ?suf:string ->
- ?std:bool ->
- Stdlib.out_channel ->
- t ->
- unit
val to_output :
- ?buf:Stdlib.Buffer.t ->
- ?len:int ->
- ?suf:string ->
- ?std:bool ->
- < output : string -> int -> int -> int > ->
- t ->
- unit
val to_file : ?len:int -> ?std:bool -> ?suf:string -> string -> t -> unit
val pp : Stdlib.Format.formatter -> t -> unit
Yojson_five.Yojson_json5
Yojson_five
module Ast : sig ... end
module Basic : sig ... end
module Let_syntax : sig ... end
module Lexer : sig ... end
module Parser : sig ... end
module Read : sig ... end
module Safe : sig ... end
module Unescape : sig ... end
module Yojson_json5 : sig ... end
Yojson_five