package mopsa

  1. Overview
  2. Docs
Legend:
Page
Library
Module
Module type
Parameter
Class
Class type
Source

Module LineEdit.UBufSource

Buffers backed by byte sequences that grow automatically. Support insertion and deletion at any position within the buffer. Include some support for UTF-8 encoding.

Sourcetype t = {
  1. mutable buf : Stdlib.Bytes.t;
  2. mutable len : int;
}
Sourceval ensure : t -> int -> unit
Sourceval create : unit -> t

Create an empty buffer.

Sourceval copy : t -> t

Creates a copy of a buffer.

Sourceval contents : t -> string

Buffer contents, as a string.

Sourceval byte_length : t -> int

Buffer size in bytes.

Sourceval uchar_length : t -> int

Buffer size in utf-8 chars.

Sourceval index_of_uchar : t -> int -> int

Byte index of the nb-th utf-8 char.

Sourceval nth : t -> int -> char

Get the byte at the specified byte index.

Sourceval sub : t -> int -> int -> string

Get the substring from the specified byte index.

Sourceval add_char : t -> char -> unit

Append a byte at the end of the buffer.

Sourceval add_substring : t -> string -> int -> int -> unit

Append a part of a string at the end of the buffer.

Sourceval add_string : t -> string -> unit

Append a string at the end of the buffer.

Sourceval insert_char : t -> int -> char -> unit

Insert a byte at the specified byte index.

Sourceval insert_substring : t -> int -> string -> int -> int -> unit

Insert a substring at the specified byte index.

Sourceval insert_string : t -> int -> string -> unit

Insert a string at the specified byte index.

Sourceval delete : t -> int -> int -> unit

Delete some bytes at the specified byte index.

Sourceval clear : t -> unit

Reset the buffer to 0 length.

Sourceval output : Stdlib.out_channel -> t -> unit

Print to buffer.

OCaml

Innovation. Community. Security.