This commit is contained in:
Simon Cruanes 2024-05-13 21:54:33 -04:00
parent f5aa4de6e7
commit 53b3f75d64
No known key found for this signature in database
GPG key ID: EBFFF6F283F3A2B4

View file

@ -54,20 +54,42 @@ val add_char : t -> char -> unit
@raise Invalid_argument if this requires the buffer to grow beyond system limits. *) @raise Invalid_argument if this requires the buffer to grow beyond system limits. *)
val append_bytes : t -> bytes -> unit val append_bytes : t -> bytes -> unit
(** Add bytes at the end *)
val append_subbytes : t -> bytes -> int -> int -> unit val append_subbytes : t -> bytes -> int -> int -> unit
(** Add byte slice at the end *)
val append_string : t -> string -> unit val append_string : t -> string -> unit
(** Add string at the end *)
val append_substring : t -> string -> int -> int -> unit val append_substring : t -> string -> int -> int -> unit
(** Add substring at the end *)
val append_buf : t -> Buffer.t -> unit val append_buf : t -> Buffer.t -> unit
(** Add content of the buffer at the end *)
val append_iter : t -> char iter -> unit val append_iter : t -> char iter -> unit
(** Adds characters from the iter *)
val append_seq : t -> char Seq.t -> unit val append_seq : t -> char Seq.t -> unit
(** Adds characters from the seq *)
val get : t -> int -> char val get : t -> int -> char
(** Get the char at the given offset *)
val unsafe_get : t -> int -> char val unsafe_get : t -> int -> char
(** Get the char at the given offset, unsafe (no bound check) *)
val set : t -> int -> char -> unit val set : t -> int -> char -> unit
(** Set the char at the given offset *)
val unsafe_set : t -> int -> char -> unit val unsafe_set : t -> int -> char -> unit
(** Set the char at the given offset, unsafe (no bound check) *)
val to_slice : t -> CCByte_slice.t val to_slice : t -> CCByte_slice.t
(** [to_slice buf] returns a slice of the current content. (** [to_slice buf] returns a slice of the current content.
The slice shares the same byte array as [buf] (until [buf] is resized). *) The slice shares the same byte array as [buf] (until [buf] is resized).
@since NEXT_RELEASE *)
val contents : t -> string val contents : t -> string
(** Copy the internal data to a string. Allocates. *) (** Copy the internal data to a string. Allocates. *)
@ -76,7 +98,12 @@ val contents_bytes : t -> bytes
(** Copy the internal data to a {!bytes}. Allocates. *) (** Copy the internal data to a {!bytes}. Allocates. *)
val iter : (char -> unit) -> t -> unit val iter : (char -> unit) -> t -> unit
(** Iterate on the content *)
val iteri : (int -> char -> unit) -> t -> unit val iteri : (int -> char -> unit) -> t -> unit
(** Iterate with index.
@since NEXT_RELEASE *)
val fold_left : ('a -> char -> 'a) -> 'a -> t -> 'a val fold_left : ('a -> char -> 'a) -> 'a -> t -> 'a
val of_iter : char iter -> t val of_iter : char iter -> t
val of_seq : char Seq.t -> t val of_seq : char Seq.t -> t