Legend:
Page
Library
Module
Module type
Parameter
Class
Class type
Source
Source file uchar_intf.ml
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146open!Import(** Interface for encoding and decoding individual Unicode scalar values. See [String.Utf]
for working with Unicode strings. *)moduletypeUtf=sig(** [to_string] encodes a Unicode scalar value in this encoding.
[of_string] interprets a string as one Unicode scalar value in this encoding, and
raises if the string cannot be interpreted as such. *)includeStringable.Swithtypet:=Uchar0.t(** Returns the number of bytes used for a given scalar value in this encoding. *)valbyte_length:Uchar0.t->int(** The name of this encoding scheme; e.g., "UTF-8". *)valcodec_name:stringendmoduletypeUchar=sig(** Unicode operations.
A [Uchar.t] represents a Unicode scalar value, which is the basic unit of Unicode.
See also [String.Utf*] submodules for Unicode support with multiple [Uchar.t] values
encoded in a string. *)open!Importtypet=Uchar0.t[@@deriving_inlinehash,sexp,sexp_grammar]includePpx_hash_lib.Hashable.Swithtypet:=tincludeSexplib0.Sexpable.Swithtypet:=tvalt_sexp_grammar:tSexplib0.Sexp_grammar.t[@@@end]typeuchar:=tincludeComparable.Swithtypet:=tincludePpx_compare_lib.Comparable.S_localwithtypet:=tincludePpx_compare_lib.Equal.S_localwithtypet:=tincludePretty_printer.Swithtypet:=tincludeInvariant.Swithtypet:=t(** [succ_exn t] is the scalar value after [t] in the set of Unicode scalar values, and
raises if [t = max_value]. *)valsucc:t->toptionvalsucc_exn:t->t(** [pred_exn t] is the scalar value before [t] in the set of Unicode scalar values, and
raises if [t = min_value]. *)valpred:t->toptionvalpred_exn:t->t(** [is_char t] is [true] iff [n] is in the latin-1 character set. *)valis_char:t->bool(** [to_char_exn t] is [t] as a [char] if it is in the latin-1 character set, and raises
otherwise. *)valto_char:t->charoptionvalto_char_exn:t->char(** [of_char c] is [c] as a Unicode scalar value. *)valof_char:char->t(** [int_is_scalar n] is [true] iff [n] is an Unicode scalar value (i.e., in the ranges
[0x0000]...[0xD7FF] or [0xE000]...[0x10FFFF]). *)valint_is_scalar:int->bool(** [of_scalar_exn n] is [n] as a Unicode scalar value. Raises if [not (int_is_scalar
i)]. *)valof_scalar:int->toptionvalof_scalar_exn:int->t(** [to_scalar t] is [t] as an integer scalar value. *)valto_scalar:t->int(** Number of bytes needed to represent [t] in UTF-8. *)valutf_8_byte_length:t->int[@@deprecated"[since 2023-11] use [Utf8.byte_length]"](** Number of bytes needed to represent [t] in UTF-16. *)valutf_16_byte_length:t->int[@@deprecated"[since 2023-11] use [Utf16le.byte_length] or [Utf16be.byte_length]"]valmin_value:tvalmax_value:t(** U+FEFF, the byte order mark. https://en.wikipedia.org/wiki/Byte_order_mark *)valbyte_order_mark:t(** U+FFFD, the Unicode replacement character.
https://en.wikipedia.org/wiki/Specials_(Unicode_block)#Replacement_character *)valreplacement_char:t(** Result of decoding a UTF codec that may contain invalid encodings. *)moduleDecode_result:sigtypet=Uchar0.utf_decode[@@immediate][@@deriving_inlinecompare,equal,hash,sexp_of]includePpx_compare_lib.Comparable.Swithtypet:=tincludePpx_compare_lib.Equal.Swithtypet:=tincludePpx_hash_lib.Hashable.Swithtypet:=tvalsexp_of_t:t->Sexplib0.Sexp.t[@@@end](** [true] iff [t] represents a Unicode scalar value. *)valis_valid:t->bool(** Number of bytes consumed to decode [t]. *)valbytes_consumed:t->int(** Returns the corresponding [uchar] if [is_valid t]. *)valuchar:t->ucharoption(** Like [uchar]. Raises if [not (is_valid t)]. *)valuchar_exn:t->uchar(** Like [uchar]. Returns [replacement_char] if [not (is_valid t)]. *)valuchar_or_replacement_char:t->ucharend(** UTF-8 encoding. See [Utf] interface. *)moduleUtf8:Utf(** UTF-16 little-endian encoding. See [Utf] interface. *)moduleUtf16le:Utf(** UTF-16 big-endian encoding. See [Utf] interface. *)moduleUtf16be:Utf(** UTF-32 little-endian encoding. See [Utf] interface. *)moduleUtf32le:Utf(** UTF-32 big-endian encoding. See [Utf] interface. *)moduleUtf32be:UtfmoduletypeUtf=Utfend