module Key_value:sig
..end
val key : Line.t -> string
val set_key : string -> Line.t -> Line.t
Line.Key_value.key
val value : Line.t -> string
val set_value : string -> Line.t -> Line.t
Line.Key_value.value
val as_int : Line.t -> int option
val as_float : Line.t -> float option
val as_bool : Line.t -> bool option
The strings yes
, y
, 1
, true
, on
,
enabled
, and enable
are all considered true.
The strings no
, n
, 0
, false
, off
,
disabled
, and disable
are all considered false.
(Case insensitive.)
val as_string : ?quoted:bool -> Line.t -> string
Backslash escapes are interpreted in the style of echo(1). The
optional argument ?quoted
(default true
) specifies whether to remove
double-quotes from the string as well (unless they are escaped).
val as_list : ?delim:char -> Line.t -> string list
The optional argument ?delim
(default ' '
) specifies the list
separator.
val section : Line.t -> string
For example, in SSH configuration files, Host statements begin a new
section. (accessor, nullable)
val set_section : string -> Line.t -> Line.t
Line.Key_value.section
val create : key:string -> value:string -> Line.t -> Line.t
Line.Key_value
substructure to a line.