package inquire
Install
dune-project
Dependency
Authors
Maintainers
Sources
sha256=0b88d89e24d4cbc0560a7c8d8ec51388990e1b27f24685029997afa52a7c720f
sha512=8b62860a8d15e41528a404a6f1b9968c3d79755607b5ea319af2e3e45516e672a785361d278279910928db4054e1800e87bcee0210ff3eabfb330713b368c827
doc/inquire.zed/Zed_string/index.html
Module Zed_string
Invalid (error, text) Exception raised when an invalid Zed_char sequence is encountered. text is the faulty text and error is a description of the first error in text.
Exception raised when trying to access a character which is outside the bounds of a string.
Type of the width of a segment of a Zed_string.t
type width = (all_width, seg_width) Result.resultType of the width of a Zed_string.t
val unsafe_of_utf8 : string -> tCreate a Zed_string.t from a utf8 encoded string.
val of_utf8 : string -> tCreate a Zed_string.t from a utf8 encoded string and check whether it's well formed.
val to_utf8 : t -> stringCreate a utf8 encoded string from a Zed_string.t.
val explode : t -> Zed_char.t listexplode str returns the list of all Zed_char.t of str.
val rev_explode : t -> Zed_char.t listexplode str returns the list of all Zed_char.t of str in reverse order.
val unsafe_explode : t -> Zed_char.t listexplode str returns the list of all Zed_char.t of str even if str is malformed.
val unsafe_rev_explode : t -> Zed_char.t listexplode str returns the list of all Zed_char.t of str in reverse order even if str is malformed.
val implode : Zed_char.t list -> timplode l returns the concatenation of all Zed_char.t of l.
val aval_width : width -> intReturns the widest available width
val init : int -> (int -> Zed_char.t) -> tinit n f returns the contenation of implode [(f 0)], implode [(f 1)], ..., implode [(f (n - 1))].
init n f creates a sequence of Uchar.t of f 0, f 1, ..., f (n-1) and implode the contenation of it.
val make : int -> Zed_char.t -> tmake n ch creates a Zed_string.t of length n filled with ch.
copy s returns a copy of s, that is, a fresh Zed_string.t containing the same elements as s.
val get : t -> int -> Zed_char.tget str idx returns the Zed_char.t at index idx in str.
get_raw str idx returns the Uchar.t at Uchar.t based index idx in str.
val empty : unit -> tempty () creates an empty Zed_string.t.
width_ofs ?start ?num str returns the width of a Zed_string.t that starts at offset start and has length less than num.
width ?start ?num str returns the width of a Zed_string.t that starts at positon start and has length less than num.
bytes str returns the number of bytes in str. It's also the index point to the end of str.
val size : t -> intsize str returns the number of Uchar.t in str.
val length : t -> intlength str returns the number of Zed_char.t in str
val next_ofs : t -> int -> intnext_ofs str ofs returns the offset of the next zed_char in str.
val prev_ofs : t -> int -> intprev_ofs str ofs returns the offset of the previous zed_char in str.
val extract : t -> index -> Zed_char.textract str ofs returns the Zed_char.t at offset ofs in str.
val extract_next : t -> index -> Zed_char.t * indexextract_next str ofs returns the Zed_char.t at offset ofs in str and the offset of the next Zed_char.t
val extract_prev : t -> index -> Zed_char.t * indexextract_prev str ofs returns the Zed_char.t at the previous offset ofs in str and this offset.
unsafe_of_uChars l returns the concatenation of all Uchar.t of l.
of_uChars l returns a tuple of which the first element is a well formed Zed_string.t concatenating of all Uchar.t of l and the second element is a list of the remaining Uchar.t.
val for_all : (Zed_char.t -> bool) -> t -> boolfor_all p zStr checks if all Zed_char.t in zStr satisfy the predicate p.
val iter : (Zed_char.t -> unit) -> t -> unititer f str applies f an all characters of str starting from the left.
val rev_iter : (Zed_char.t -> unit) -> t -> unititer f str applies f an all characters of str starting from the right.
val fold : (Zed_char.t -> 'a -> 'a) -> t -> 'a -> 'afold f str acc applies f on all characters of str starting from the left, accumulating a value.
val rev_fold : (Zed_char.t -> 'a -> 'a) -> t -> 'a -> 'afold f str acc applies f on all characters of str starting from the right, accumulating a value.
val map : (Zed_char.t -> Zed_char.t) -> t -> tmap f str maps all characters of str with f.
val rev_map : (Zed_char.t -> Zed_char.t) -> t -> tmap f str maps all characters of str with f in reverse order.
val check_range : t -> int -> boolnext str i, prev str i The operation is valid if i points the valid element, i.e. the returned value may point the location beyond valid elements by one. If i does not point a valid element, the results are unspecified.
move str i n if n >= 0, then returns n-th character after i and otherwise returns -n-th character before i. If there is no such character, or i does not point a valid character, the result is unspecified.
move_raw str i n if n >= 0, then returns n-th Uchar.t after i and otherwise returns -n-th Uchar.t before i. If there is no such Uchar.t, or i does not point a valid Uchar.t, the result is unspecified.
compare_index str i j returns a positive integer if i is the location placed after j in str, 0 if i and j point the same location, and a negative integer if i is the location placed before j in str.
sub_ofs ofs len str returns the sub-string of str starting at byte-offset ofs and of byte-length len.
sub ~pos ~len str returns the sub-string of str starting at position pos and of length len.
starts_with ~prefix str returns true if str starts with prefix.
unsafe_append str1 str2 returns the concatenation of str1 and str2 without sequence validation.
module Buf : sig ... end