module UCS4:sig..end
typet =(int32, Bigarray.int32_elt, Bigarray.c_layout) Bigarray.Array1.t
exception Malformed_code
validate s
If s is valid UCS4 then successes otherwise raises Malformed_code.
Other functions assume strings are valid UCS4, so it is prudent
to test their validity for strings from untrusted origins.val validate : t -> unitval get : t -> int -> Main.Type.UChar.tget s n returns n-th Unicode character of s.
init len f
returns a new string which contains len Unicode characters.
The i-th Unicode character is initialised by f i
val init : int -> (int -> Main.Type.UChar.t) -> tlength s returns the number of Unicode characters contained in sval length : t -> int0typeindex =int
nth s n returns the position of the n-th Unicode character.
The call requires O(n)-timeval nth : t -> int -> indexfirst s : The position of the head of the last Unicode character.val first : t -> indexlast s : The position of the head of the last Unicode character.val last : t -> indexlook s i
returns the Unicode character of the location i in the string s.val look : t -> index -> Main.Type.UChar.tout_of_range s i
tests whether i points the valid position of s.val out_of_range : t -> index -> boolcompare_aux s i1 i2 returns
If i1 is the position located before i2, a value < 0,
If i1 and i2 points the same location, 0,
If i1 is the position located after i2, a value > 0.val compare_index : t -> index -> index -> intnext s i
returns the position of the head of the Unicode character
located immediately after i.
If i is a valid position, the function always success.
If i is a valid position and there is no Unicode character after i,
the position outside s is returned.
If i is not a valid position, the behaviour is undefined.val next : t -> index -> indexprev s i
returns the position of the head of the Unicode character
located immediately before i.
If i is a valid position, the function always success.
If i is a valid position and there is no Unicode character before i,
the position outside s is returned.
If i is not a valid position, the behaviour is undefined.val prev : t -> index -> indexmove s i n :
If n >= 0, returns n-th Unicode character after i.
If n < 0, returns -n-th Unicode character before i.
If there is no such character, the result is unspecified.val move : t -> index -> int -> indexiter f s :
Apply f to all Unicode characters in s.
The order of application is same to the order
in the Unicode characters in s.val iter : (Main.Type.UChar.t -> unit) -> t -> unitval compare : t -> t -> intmodule Buf:sig..end