From ef312564ca84a2b49fc291434d8fb2f8501bb618 Mon Sep 17 00:00:00 2001 From: Sébastien Dailly Date: Tue, 15 Nov 2016 13:00:01 +0100 Subject: Initial commit --- UTF8.mli | 61 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 61 insertions(+) create mode 100755 UTF8.mli (limited to 'UTF8.mli') diff --git a/UTF8.mli b/UTF8.mli new file mode 100755 index 0000000..c1fa400 --- /dev/null +++ b/UTF8.mli @@ -0,0 +1,61 @@ +(** UTF8 is used internally for all strings + + The module is intentionaly opaque. + + *) + +(** An UTF8 encoded string *) +type t + +val empty: t + +(** Decode a string in the current locale *) +val decode: string -> t + +(** Use this to with a known UTF8 encoded string *) +val from_utf8string: string -> t + +(** Encode to the string to the user locale *) +val encode: t -> string + +val to_utf8string: t -> string + +val trim: t -> t + +val length: t -> int + +val get: t -> int -> t + +val rev_explode : t -> t list + +val split: t -> sep:t -> t + +val fold : (t -> 'a -> 'a) -> t -> 'a -> 'a + +val implode : t list -> t + +val rev_implode : t list -> t + +val compare: t -> t -> int + +module Buffer : sig + + type buffer + + val create : int -> buffer + + val contents : buffer -> t + + val add_string : buffer -> t -> unit + + val add_char: buffer -> char -> unit + +end + +module Printf : sig + + val bprintf : Buffer.buffer -> ('a, Buffer.buffer, unit) format -> 'a + + val sprintf : ('a, unit, string) format -> 'a + +end -- cgit v1.2.3