diff --git a/index.html b/index.html index 0a12e78..5c79edc 100644 --- a/index.html +++ b/index.html @@ -11,8 +11,8 @@

OCaml package documentation

    -
  1. yojson 2.2.0
  2. -
  3. yojson-five 2.2.0
  4. +
  5. yojson 2.2.1
  6. +
  7. yojson-five 2.2.1
diff --git a/yojson-five/Yojson_five/Ast/index.html b/yojson-five/Yojson_five/Ast/index.html deleted file mode 100644 index 779e9d7..0000000 --- a/yojson-five/Yojson_five/Ast/index.html +++ /dev/null @@ -1,19 +0,0 @@ - -Ast (yojson-five.Yojson_five.Ast)

Module Yojson_five.Ast

type t =
  1. | Assoc of (string * t) list
  2. | List of t list
  3. | StringLit of string
  4. | IntLit of string
  5. | FloatLit of string
  6. | Bool of bool
  7. | Null
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
\ No newline at end of file diff --git a/yojson-five/Yojson_five/Basic/index.html b/yojson-five/Yojson_five/Basic/index.html index 328f5a1..db86b14 100644 --- a/yojson-five/Yojson_five/Basic/index.html +++ b/yojson-five/Yojson_five/Basic/index.html @@ -1,94 +1,34 @@ -Basic (yojson-five.Yojson_five.Basic)

Module Yojson_five.Basic

include module type of struct include Yojson.Basic end

Type of the JSON tree

JSON writers

val to_string : +Basic (yojson-five.Yojson_five.Basic)

Module Yojson_five.Basic

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}1 -> - string

Write a compact JSON value to a string.

  • parameter buf

    allows to reuse an existing buffer created with Buffer.create. The buffer is cleared of all contents before starting and right before returning.

  • parameter len

    initial length of the output buffer.

  • parameter suf

    appended to the output as a suffix, defaults to empty string.

  • parameter std

    use only standard JSON syntax, i.e. convert tuples and variants into standard JSON (if applicable), refuse to print NaN and infinities, require the root node to be either an object or an array. Default is false.

  • raises Json_error

    if float value is not allowed in standard JSON.

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.

val to_file : ?len:int -> ?std:bool -> ?suf:string -> string -> {t}1 -> unit

Write a compact JSON value to a file. See to_string for the role of the optional arguments and raised exceptions.

  • parameter suf

    is a suffix appended to the output Newline by default for POSIX compliance.

val to_buffer : ?suf:string -> ?std:bool -> Stdlib.Buffer.t -> {t}1 -> unit

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.

  • parameter suf

    is the suffix ouf each value written. Newline by default. See to_string for the role of the optional arguments and raised exceptions.

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.

  • parameter suf

    is the suffix of each value written. Newline by default. See to_channel for the role of the optional arguments and raised exceptions.

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.

  • parameter suf

    is the suffix of each value written. Newline by default. See to_string for the role of the optional arguments and raised exceptions.

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.

  • parameter suf

    is the suffix of each value written. Newline by default. See to_string for the role of the optional arguments and raised exceptions.

val write_t : Stdlib.Buffer.t -> {t}1 -> unit

Write the given JSON value to the given buffer. Provided as a writer function for atdgen.

Miscellaneous

val sort : {t}1 -> {t}1

Sort object fields (stable sort, comparing field names and treating them as byte sequences)

val pp : Stdlib.Format.formatter -> {t}1 -> unit

Pretty printer, useful for debugging

val show : {t}1 -> string

Convert value to string, useful for debugging

val equal : {t}1 -> {t}1 -> bool

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

val pretty_print : ?std:bool -> Stdlib.Format.formatter -> {t}1 -> unit

Pretty-print into a Format.formatter. See to_string for the role of the optional std argument.

  • raises Json_error

    if float value is not allowed in standard JSON.

  • since 1.3.1
val pretty_to_string : ?std:bool -> {t}1 -> string

Pretty-print into a string. See to_string for the role of the optional std argument. See pretty_print for raised exceptions.

val pretty_to_channel : ?std:bool -> Stdlib.out_channel -> {t}1 -> unit

Pretty-print to a channel. See to_string for the role of the optional std argument. See pretty_print for raised exceptions.

val prettify : ?std:bool -> string -> string

Combined parser and pretty-printer. See to_string for the role of the optional std argument and raised exceptions.

val compact : ?std:bool -> string -> string

Combined parser and printer. See to_string for the role of the optional std argument and raised exceptions.

JSON readers

exception Finally of exn * exn

Exception describing a failure in both finalizer and parsing.

type lexer_state = {
  1. buf : Stdlib.Buffer.t;
  2. mutable lnum : int;
  3. mutable bol : int;
  4. mutable fname : string option;
}

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.

  • parameter stream

    indicates whether more data may follow. The default value is false and indicates that only JSON whitespace can be found between the end of the JSON value and the end of the input.

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.

  • parameter fin

    finalization function executed once when the end of the sequence is reached either because there is no more input or because the input could not be parsed, raising an exception.

  • raises Finally

    When the parsing and the finalizer both raised, Finally (exn, fin_exn) is raised, exn being the parsing exception and fin_exn the finalizer one.

    See from_string for the meaning of the other optional arguments and other raised exceptions.

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.

  • raises Finally

    When the parsing and the finalizer both raised, Finally (exn, fin_exn) is raised, exn being the parsing exception and fin_exn the finalizer one.

    See seq_from_channel for the meaning of the optional fin argument and other raised exceptions.

type json_line = [
  1. | `Json of {t}1
  2. | `Exn of exn
]

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
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
\ No newline at end of file + < 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
val equal : t -> t -> bool
\ No newline at end of file diff --git a/yojson-five/Yojson_five/Let_syntax/Result/index.html b/yojson-five/Yojson_five/Let_syntax/Result/index.html deleted file mode 100644 index 85c5b1e..0000000 --- a/yojson-five/Yojson_five/Let_syntax/Result/index.html +++ /dev/null @@ -1,5 +0,0 @@ - -Result (yojson-five.Yojson_five.Let_syntax.Result)

Module Let_syntax.Result

val let* : - ('a, 'b) Stdlib.result -> - ('a -> ('c, 'b) Stdlib.result) -> - ('c, 'b) Stdlib.result
val let+ : ('a, 'b) Stdlib.result -> ('a -> 'c) -> ('c, 'b) Stdlib.result
\ No newline at end of file diff --git a/yojson-five/Yojson_five/Let_syntax/index.html b/yojson-five/Yojson_five/Let_syntax/index.html deleted file mode 100644 index a9b900a..0000000 --- a/yojson-five/Yojson_five/Let_syntax/index.html +++ /dev/null @@ -1,2 +0,0 @@ - -Let_syntax (yojson-five.Yojson_five.Let_syntax)

Module Yojson_five.Let_syntax

module Result : sig ... end
\ No newline at end of file diff --git a/yojson-five/Yojson_five/Lexer/index.html b/yojson-five/Yojson_five/Lexer/index.html deleted file mode 100644 index 71e78c3..0000000 --- a/yojson-five/Yojson_five/Lexer/index.html +++ /dev/null @@ -1,8 +0,0 @@ - -Lexer (yojson-five.Yojson_five.Lexer)

Module Yojson_five.Lexer

val __sedlex_table_12 : string
val __sedlex_table_5 : string
val __sedlex_table_20 : string
val __sedlex_table_21 : string
val __sedlex_table_16 : string
val __sedlex_table_19 : string
val __sedlex_table_9 : string
val __sedlex_table_13 : string
val __sedlex_table_2 : string
val __sedlex_table_1 : string
val __sedlex_table_3 : string
val __sedlex_table_4 : string
val __sedlex_table_6 : string
val __sedlex_table_8 : string
val __sedlex_table_10 : string
val __sedlex_table_11 : string
val __sedlex_table_15 : string
val __sedlex_table_17 : string
val __sedlex_table_7 : string
val __sedlex_table_18 : string
val __sedlex_table_14 : string
val __sedlex_partition_7 : int -> int
val __sedlex_partition_12 : int -> int
val __sedlex_partition_15 : int -> int
val __sedlex_partition_23 : int -> int
val __sedlex_partition_11 : int -> int
val __sedlex_partition_22 : int -> int
val __sedlex_partition_1 : int -> int
val __sedlex_partition_19 : int -> int
val __sedlex_partition_4 : int -> int
val __sedlex_partition_5 : int -> int
val __sedlex_partition_21 : int -> int
val __sedlex_partition_24 : int -> int
val __sedlex_partition_18 : int -> int
val __sedlex_partition_10 : int -> int
val __sedlex_partition_2 : int -> int
val __sedlex_partition_3 : int -> int
val __sedlex_partition_8 : int -> int
val __sedlex_partition_14 : int -> int
val __sedlex_partition_20 : int -> int
val __sedlex_partition_6 : int -> int
val __sedlex_partition_13 : int -> int
val __sedlex_partition_9 : int -> int
val __sedlex_partition_16 : int -> int
val __sedlex_partition_17 : int -> int
type token =
  1. | OPEN_PAREN
  2. | CLOSE_PAREN
  3. | OPEN_BRACE
  4. | CLOSE_BRACE
  5. | OPEN_BRACKET
  6. | CLOSE_BRACKET
  7. | COLON
  8. | COMMA
  9. | COMMENT of string
  10. | TRUE
  11. | FALSE
  12. | NULL
  13. | FLOAT of string
  14. | INT_OR_FLOAT of string
  15. | INT of string
  16. | STRING of string
  17. | IDENTIFIER_NAME of string
val pp_token : Stdlib.Format.formatter -> token -> unit
val string_lex_single : - Sedlexing.lexbuf -> - Stdlib.Buffer.t -> - (string, string) Stdlib.result
val string_lex_double : - Sedlexing.lexbuf -> - Stdlib.Buffer.t -> - (string, string) Stdlib.result
val string_lex : Sedlexing.lexbuf -> string -> (string, string) Stdlib.result
val lex : token list -> Sedlexing.lexbuf -> (token list, string) Stdlib.result
\ No newline at end of file diff --git a/yojson-five/Yojson_five/Parser/index.html b/yojson-five/Yojson_five/Parser/index.html deleted file mode 100644 index eafcb8d..0000000 --- a/yojson-five/Yojson_five/Parser/index.html +++ /dev/null @@ -1,26 +0,0 @@ - -Parser (yojson-five.Yojson_five.Parser)

Module 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
\ No newline at end of file diff --git a/yojson-five/Yojson_five/Read/Make/argument-1-F/index.html b/yojson-five/Yojson_five/Read/Make/argument-1-F/index.html deleted file mode 100644 index 52ad25b..0000000 --- a/yojson-five/Yojson_five/Read/Make/argument-1-F/index.html +++ /dev/null @@ -1,2 +0,0 @@ - -F (yojson-five.Yojson_five.Read.Make.F)

Parameter Make.F

type t
val convert : Ast.t -> t
\ No newline at end of file diff --git a/yojson-five/Yojson_five/Read/Make/index.html b/yojson-five/Yojson_five/Read/Make/index.html deleted file mode 100644 index 82eca61..0000000 --- a/yojson-five/Yojson_five/Read/Make/index.html +++ /dev/null @@ -1,14 +0,0 @@ - -Make (yojson-five.Yojson_five.Read.Make)

Module Read.Make

Parameters

module F : S

Signature

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
\ No newline at end of file diff --git a/yojson-five/Yojson_five/Read/index.html b/yojson-five/Yojson_five/Read/index.html deleted file mode 100644 index e899ab0..0000000 --- a/yojson-five/Yojson_five/Read/index.html +++ /dev/null @@ -1,2 +0,0 @@ - -Read (yojson-five.Yojson_five.Read)

Module Yojson_five.Read

module type S = sig ... end
module type Out = sig ... end
module Make (F : S) : Out with type t = F.t
\ No newline at end of file diff --git a/yojson-five/Yojson_five/Read/module-type-Out/index.html b/yojson-five/Yojson_five/Read/module-type-Out/index.html deleted file mode 100644 index b56de08..0000000 --- a/yojson-five/Yojson_five/Read/module-type-Out/index.html +++ /dev/null @@ -1,14 +0,0 @@ - -Out (yojson-five.Yojson_five.Read.Out)

Module type Read.Out

type 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
\ No newline at end of file diff --git a/yojson-five/Yojson_five/Read/module-type-S/index.html b/yojson-five/Yojson_five/Read/module-type-S/index.html deleted file mode 100644 index 894b5e9..0000000 --- a/yojson-five/Yojson_five/Read/module-type-S/index.html +++ /dev/null @@ -1,2 +0,0 @@ - -S (yojson-five.Yojson_five.Read.S)

Module type Read.S

type t
val convert : Ast.t -> t
\ No newline at end of file diff --git a/yojson-five/Yojson_five/Safe/index.html b/yojson-five/Yojson_five/Safe/index.html index f722e3a..ce9d472 100644 --- a/yojson-five/Yojson_five/Safe/index.html +++ b/yojson-five/Yojson_five/Safe/index.html @@ -1,97 +1,34 @@ -Safe (yojson-five.Yojson_five.Safe)

Module Yojson_five.Safe

include module type of struct include Yojson.Safe end

Type of the JSON tree

val pp : Stdlib.Format.formatter -> {t}2 -> unit

Pretty printer, useful for debugging

val show : {t}2 -> string

Convert value to string, useful for debugging

val equal : {t}2 -> {t}2 -> bool

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"

JSON writers

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
val to_string : ?buf:Stdlib.Buffer.t -> ?len:int -> ?suf:string -> ?std:bool -> - {t}2 -> - string

Write a compact JSON value to a string.

  • parameter buf

    allows to reuse an existing buffer created with Buffer.create. The buffer is cleared of all contents before starting and right before returning.

  • parameter len

    initial length of the output buffer.

  • parameter suf

    appended to the output as a suffix, defaults to empty string.

  • parameter std

    use only standard JSON syntax, i.e. convert tuples and variants into standard JSON (if applicable), refuse to print NaN and infinities, require the root node to be either an object or an array. Default is false.

  • raises Json_error

    if float value is not allowed in standard JSON.

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.

val to_file : ?len:int -> ?std:bool -> ?suf:string -> string -> {t}2 -> unit

Write a compact JSON value to a file. See to_string for the role of the optional arguments and raised exceptions.

  • parameter suf

    is a suffix appended to the output Newline by default for POSIX compliance.

val to_buffer : ?suf:string -> ?std:bool -> Stdlib.Buffer.t -> {t}2 -> unit

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.

  • parameter suf

    is the suffix ouf each value written. Newline by default. See to_string for the role of the optional arguments and raised exceptions.

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.

  • parameter suf

    is the suffix of each value written. Newline by default. See to_channel for the role of the optional arguments and raised exceptions.

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.

  • parameter suf

    is the suffix of each value written. Newline by default. See to_string for the role of the optional arguments and raised exceptions.

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.

  • parameter suf

    is the suffix of each value written. Newline by default. See to_string for the role of the optional arguments and raised exceptions.

val write_t : Stdlib.Buffer.t -> {t}2 -> unit

Write the given JSON value to the given buffer. Provided as a writer function for atdgen.

Miscellaneous

val sort : {t}2 -> {t}2

Sort object fields (stable sort, comparing field names and treating them as byte sequences)

JSON pretty-printing

val pretty_print : ?std:bool -> Stdlib.Format.formatter -> {t}2 -> unit

Pretty-print into a Format.formatter. See to_string for the role of the optional std argument.

  • raises Json_error

    if float value is not allowed in standard JSON.

  • since 1.3.1
val pretty_to_string : ?std:bool -> {t}2 -> string

Pretty-print into a string. See to_string for the role of the optional std argument. See pretty_print for raised exceptions.

val pretty_to_channel : ?std:bool -> Stdlib.out_channel -> {t}2 -> unit

Pretty-print to a channel. See to_string for the role of the optional std argument. See pretty_print for raised exceptions.

val prettify : ?std:bool -> string -> string

Combined parser and pretty-printer. See to_string for the role of the optional std argument and raised exceptions.

val compact : ?std:bool -> string -> string

Combined parser and printer. See to_string for the role of the optional std argument and raised exceptions.

JSON readers

exception Finally of exn * exn

Exception describing a failure in both finalizer and parsing.

type lexer_state = {
  1. buf : Stdlib.Buffer.t;
  2. mutable lnum : int;
  3. mutable bol : int;
  4. mutable fname : string option;
}

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.

  • parameter stream

    indicates whether more data may follow. The default value is false and indicates that only JSON whitespace can be found between the end of the JSON value and the end of the input.

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.

  • parameter fin

    finalization function executed once when the end of the sequence is reached either because there is no more input or because the input could not be parsed, raising an exception.

  • raises Finally

    When the parsing and the finalizer both raised, Finally (exn, fin_exn) is raised, exn being the parsing exception and fin_exn the finalizer one.

    See from_string for the meaning of the other optional arguments and other raised exceptions.

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.

  • raises Finally

    When the parsing and the finalizer both raised, Finally (exn, fin_exn) is raised, exn being the parsing exception and fin_exn the finalizer one.

    See seq_from_channel for the meaning of the optional fin argument and other raised exceptions.

type json_line = [
  1. | `Json of {t}2
  2. | `Exn of exn
]

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
\ No newline at end of file + < 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
val equal : t -> t -> bool
\ No newline at end of file diff --git a/yojson-five/Yojson_five/Unescape/index.html b/yojson-five/Yojson_five/Unescape/index.html deleted file mode 100644 index 0153355..0000000 --- a/yojson-five/Yojson_five/Unescape/index.html +++ /dev/null @@ -1,2 +0,0 @@ - -Unescape (yojson-five.Yojson_five.Unescape)

Module Yojson_five.Unescape

val (%) : int -> int -> int
val (<<) : int -> int -> int
val (>>) : int -> int -> int
val (&) : int -> int -> int
val utf_8_string_of_unicode : int -> (string, string) Stdlib.result
val unescape : string -> (string, string) Stdlib.result
\ No newline at end of file diff --git a/yojson-five/Yojson_five/Yojson_json5/Basic/index.html b/yojson-five/Yojson_five/Yojson_json5/Basic/index.html deleted file mode 100644 index fdc7fd6..0000000 --- a/yojson-five/Yojson_five/Yojson_json5/Basic/index.html +++ /dev/null @@ -1,34 +0,0 @@ - -Basic (yojson-five.Yojson_five.Yojson_json5.Basic)

Module Yojson_json5.Basic

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
val equal : t -> t -> bool
\ No newline at end of file diff --git a/yojson-five/Yojson_five/Yojson_json5/Safe/index.html b/yojson-five/Yojson_five/Yojson_json5/Safe/index.html deleted file mode 100644 index 2af7d32..0000000 --- a/yojson-five/Yojson_five/Yojson_json5/Safe/index.html +++ /dev/null @@ -1,34 +0,0 @@ - -Safe (yojson-five.Yojson_five.Yojson_json5.Safe)

Module 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
val equal : t -> t -> bool
\ No newline at end of file diff --git a/yojson-five/Yojson_five/Yojson_json5/index.html b/yojson-five/Yojson_five/Yojson_json5/index.html deleted file mode 100644 index 7d0db1e..0000000 --- a/yojson-five/Yojson_five/Yojson_json5/index.html +++ /dev/null @@ -1,2 +0,0 @@ - -Yojson_json5 (yojson-five.Yojson_five.Yojson_json5)

Module Yojson_five.Yojson_json5

module Safe : sig ... end
module Basic : sig ... end
\ No newline at end of file diff --git a/yojson-five/Yojson_five/index.html b/yojson-five/Yojson_five/index.html index 0ce6e11..cd8128a 100644 --- a/yojson-five/Yojson_five/index.html +++ b/yojson-five/Yojson_five/index.html @@ -1,2 +1,2 @@ -Yojson_five (yojson-five.Yojson_five)

Module 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
\ No newline at end of file +Yojson_five (yojson-five.Yojson_five)

Module Yojson_five

module Safe : sig ... end
module Basic : sig ... end
\ No newline at end of file