package stdune

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

A buffer for efficiently building strings.

val create : int -> t

Creates a t with the given capacity.

val add_char : t -> char -> unit

Adds a char to the end of the buffer.

val add_string : t -> string -> unit

Adds a string to the end of the buffer.

val add_substring : t -> string -> pos:int -> len:int -> unit

Adds a substring to the end of the buffer.

val build_exact_exn : t -> string

Returns the built string. Raises if the buffer is not full. Subsequent calls to add_char or add_string will also raise.