package otoml

  1. Overview
  2. Docs

Parameters

module I : TomlInteger
module F : TomlFloat
module D : TomlDate

Signature

type toml_integer = I.t
type toml_float = F.t
type toml_date = D.t
type t =
  1. | TomlString of string
  2. | TomlInteger of toml_integer
  3. | TomlFloat of toml_float
  4. | TomlBoolean of bool
  5. | TomlOffsetDateTime of toml_date
  6. | TomlLocalDateTime of toml_date
  7. | TomlLocalDate of toml_date
  8. | TomlLocalTime of toml_date
  9. | TomlArray of t list
  10. | TomlTable of (string * t) list
  11. | TomlInlineTable of (string * t) list
  12. | TomlTableArray of t list
module Printer : sig ... end
module Parser : sig ... end

Constructors

val string : string -> t
val integer : toml_integer -> t
val float : toml_float -> t
val boolean : bool -> t
val offset_datetime : toml_date -> t
val local_datetime : toml_date -> t
val local_date : toml_date -> t
val local_time : toml_date -> t
val array : t list -> t
val table : (string * t) list -> t
val inline_table : (string * t) list -> t

Accessors

val get_value : t -> t
val get_table : t -> (string * t) list
val get_array : ?strict:bool -> t -> t list

In non-strict mode, forces a value x to a single-item array [x]

val get_string : ?strict:bool -> t -> string
val get_integer : ?strict:bool -> t -> toml_integer
val get_float : ?strict:bool -> t -> toml_float
val get_boolean : ?strict:bool -> t -> bool
val get_offset_datetime : t -> toml_date
val get_local_datetime : t -> toml_date
val get_datetime : t -> toml_date
val get_local_date : t -> toml_date
val get_date : t -> toml_date
val get_local_time : t -> toml_date

High-level interface

val list_table_keys : t -> string list
val find : t -> (t -> 'a) -> string list -> 'a
val find_opt : t -> (t -> 'a) -> string list -> 'a option
val find_or : default:'a -> t -> (t -> 'a) -> string list -> 'a
val find_result : t -> (t -> 'a) -> string list -> ('a, string) Stdlib.result
val update : ?use_inline_tables:bool -> t -> string list -> t option -> t
OCaml

Innovation. Community. Security.