package otoml

  1. Overview
  2. Docs
TOML parsing, manipulation, and pretty-printing library (1.0.0-compliant)

Install

Dune Dependency

Authors

Maintainers

Sources

0.9.2.tar.gz
md5=9fe793f78b49843f641118ce5c8aec59
sha512=3ab1c1128155aa12acf29d455a7fe6d32bba5982ef57dcf6095e6890f913d9663880f308d92e51111c65986f56126daaf575e820b31b15b009b1d824dca81d52

doc/otoml/Otoml/index.html

Module OtomlSource

Default TOML implementation.

Sourceexception Key_error of string

Raised when a TOML table does not have specified key.

Sourceexception Type_error of string

Raised when an operation is performed with an incompatible TOML type.

Sourceexception Parse_error of (int * int) option * string

Raised when a TOML document cannot be parsed due to syntax or semantic errors.

Sourcetype t =
  1. | TomlString of string
  2. | TomlInteger of int
  3. | TomlFloat of float
  4. | TomlBoolean of bool
  5. | TomlOffsetDateTime of string
  6. | TomlLocalDateTime of string
  7. | TomlLocalDate of string
  8. | TomlLocalTime of string
  9. | TomlArray of t list
  10. | TomlTable of (string * t) list
  11. | TomlInlineTable of (string * t) list
  12. | TomlTableArray of t list
Sourcemodule Printer : sig ... end
Sourcemodule Parser : sig ... end

Constructors

Sourceval string : string -> t
Sourceval integer : int -> t
Sourceval float : float -> t
Sourceval boolean : bool -> t
Sourceval offset_datetime : string -> t
Sourceval local_datetime : string -> t
Sourceval local_date : string -> t
Sourceval local_time : string -> t
Sourceval array : t list -> t
Sourceval table : (string * t) list -> t
Sourceval inline_table : (string * t) list -> t

Accessors

Sourceval get_value : t -> t
Sourceval get_table : t -> (string * t) list
Sourceval get_array : ?strict:bool -> (t -> 'a) -> t -> 'a list

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

Sourceval get_string : ?strict:bool -> t -> string
Sourceval get_integer : ?strict:bool -> t -> int
Sourceval get_float : ?strict:bool -> t -> float
Sourceval get_boolean : ?strict:bool -> t -> bool

High-level interface

Sourceval list_table_keys : t -> string list
Sourceval find : t -> (t -> 'a) -> string list -> 'a
Sourceval find_opt : t -> (t -> 'a) -> string list -> 'a option
Sourceval find_or : default:'a -> t -> (t -> 'a) -> string list -> 'a
Sourceval find_result : t -> (t -> 'a) -> string list -> ('a, string) result
Sourceval path_exists : t -> string list -> bool
Sourceval update : ?use_inline_tables:bool -> t -> string list -> t option -> t
Sourcemodule Base : sig ... end
OCaml

Innovation. Community. Security.