package containers

  1. Overview
  2. Docs
A modular, clean and powerful extension of the OCaml standard library

Install

Dune Dependency

Authors

Maintainers

Sources

containers-3.13.tbz
sha256=372df86e2a41e86c959c28a3392eb2ffd89754d1e5af2aaa09537654af57b1da
sha512=7d87d44065612095fa0342a9c95a2c4cfdf73d5af47c6fce24262cf2870c36dee70ebecd056113aa9c1643256bc032c08530f5083061c44602c0da5a132c2d6c

doc/containers/CCByte_buffer/index.html

Module CCByte_bufferSource

Byte buffer.

A dynamic vector of bytes.

  • since 3.7
Sourcetype t
Sourcetype 'a iter = ('a -> unit) -> unit
Sourceval create : ?cap:int -> unit -> t

Create a new buffer with given initial capacity.

Sourceval length : t -> int

Current length.

Sourceval is_empty : t -> bool

is_empty b is length b=0

Sourceval capacity : t -> int

Current capacity (size of the array returned by bytes)

Sourceval bytes : t -> bytes

Access the underlying byte buffer. This buffer can change after operations that affect the capacity (e.g. add_char).

Sourceval clear : t -> unit
Sourceval ensure_cap : t -> int -> unit

ensure_cap self n ensures that capacity self >= n.

Sourceval shrink_to : t -> int -> unit

shrink_to buf n reduces length buf to at most n. Does nothing if the length is already <= n.

Sourceval add_char : t -> char -> unit

Push a character at the end.

Sourceval append_bytes : t -> bytes -> unit
Sourceval append_subbytes : t -> bytes -> int -> int -> unit
Sourceval append_string : t -> string -> unit
Sourceval append_substring : t -> string -> int -> int -> unit
Sourceval append_buf : t -> Buffer.t -> unit
Sourceval append_iter : t -> char iter -> unit
Sourceval append_seq : t -> char Seq.t -> unit
Sourceval get : t -> int -> char
Sourceval unsafe_get : t -> int -> char
Sourceval set : t -> int -> char -> unit
Sourceval unsafe_set : t -> int -> char -> unit
Sourceval contents : t -> string

Copy the internal data to a string

Sourceval contents_bytes : t -> bytes

Copy the internal data to a byte buffer

Sourceval iter : (char -> unit) -> t -> unit
Sourceval fold_left : ('a -> char -> 'a) -> 'a -> t -> 'a
Sourceval of_iter : char iter -> t
Sourceval of_seq : char Seq.t -> t
Sourceval to_iter : t -> char iter
Sourceval to_seq : t -> char Seq.t
OCaml

Innovation. Community. Security.