package camomile

  1. Overview
  2. Docs
A Unicode library

Install

Dune Dependency

Authors

Maintainers

Sources

v2.0.0.tar.gz
md5=41e02d124c3fa29ea511110d2c6532de
sha512=b0ae3d921f65390e8ec88a04901dd097b568db9f9ae70fb328e9d3ddb2dd8922b9a8e8da9ace91ad9cb5f6a1310ae5b6ba502e287d6c828f4d60622289316ac8

doc/camomile.lib/CamomileLib/UText/index.html

Module CamomileLib.UText

An implementation of Unicode string.

An implementation of Unicode string. Internally, it uses integer array. The semantics matches the description of UStorage.

type mutability = [
  1. | `Mutable
  2. | `Immutable
]

Phantom type for distinguishing mutability

type 'a text
type utext = [ `Immutable ] text
type ustring = [ `Mutable ] text
type t = utext
val utext_of_ustring : ustring -> utext
val ustring_of_utext : utext -> ustring
val get : 'a text -> int -> UChar.t
val set : ustring -> int -> UChar.t -> unit

set s i u sets the i-th character in s to u.

type index
val look : 'a text -> index -> UChar.t
val nth : 'a text -> int -> index
val first : 'a text -> index
val last : 'a text -> index
val out_of_range : 'a text -> index -> bool
val compare_index : 'a text -> index -> index -> int
val next : 'a text -> index -> index
val prev : 'a text -> index -> index
val move : 'a text -> index -> int -> index
val length : 'a text -> int
val of_string : string -> utext

Conversion from Latin-1 strings.

val init : int -> (int -> UChar.t) -> utext
val init_ustring : int -> (int -> UChar.t) -> ustring
val make : int -> UChar.t -> ustring

The semantics of these function are similar to the equivalents of string.

val copy : ustring -> ustring
val sub : 'a text -> int -> int -> 'a text
val fill : ustring -> int -> int -> UChar.t -> unit
val blit : 'a text -> int -> ustring -> int -> int -> unit
val append : 'a text -> 'b text -> 'a text
val iter : (UChar.t -> unit) -> 'a text -> unit
val compare : 'a text -> 'b text -> int
module Buf : sig ... end
OCaml

Innovation. Community. Security.