module Convert: sig
.. end
Conversions for shtream adaptors. These produce shtream warnings
(calling Shtream.warn
) if the value cannot be coerced.
val convert : (string -> 'a) -> string -> string -> string -> 'a
Create a custom conversion.
Adaptor.Convert.convert conv tyname loc str
applies the conversion conv
to str
; if the conversion raises
Failure
, then it produces a warning, with tyname
as the name of
the target type and loc
as the name of the function given in the
message.
val to_int : string -> string -> int
Convert a string to an integer, with shtream warning on failure.
Convert.to_int loc str
returns str
as an integer or raises a warning
attributed to loc
.
val to_float : string -> string -> float
Convert a string to a float, with shtream warning on failure.
Convert.to_float loc str
returns str
as a float or raises a warning
attributed to loc
.