Skip to content

Commit 53b3f75

Browse files
committed
docs
1 parent f5aa4de commit 53b3f75

File tree

1 file changed

+28
-1
lines changed

1 file changed

+28
-1
lines changed

src/core/CCByte_buffer.mli

Lines changed: 28 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,20 +54,42 @@ val add_char : t -> char -> unit
5454
@raise Invalid_argument if this requires the buffer to grow beyond system limits. *)
5555

5656
val append_bytes : t -> bytes -> unit
57+
(** Add bytes at the end *)
58+
5759
val append_subbytes : t -> bytes -> int -> int -> unit
60+
(** Add byte slice at the end *)
61+
5862
val append_string : t -> string -> unit
63+
(** Add string at the end *)
64+
5965
val append_substring : t -> string -> int -> int -> unit
66+
(** Add substring at the end *)
67+
6068
val append_buf : t -> Buffer.t -> unit
69+
(** Add content of the buffer at the end *)
70+
6171
val append_iter : t -> char iter -> unit
72+
(** Adds characters from the iter *)
73+
6274
val append_seq : t -> char Seq.t -> unit
75+
(** Adds characters from the seq *)
76+
6377
val get : t -> int -> char
78+
(** Get the char at the given offset *)
79+
6480
val unsafe_get : t -> int -> char
81+
(** Get the char at the given offset, unsafe (no bound check) *)
82+
6583
val set : t -> int -> char -> unit
84+
(** Set the char at the given offset *)
85+
6686
val unsafe_set : t -> int -> char -> unit
87+
(** Set the char at the given offset, unsafe (no bound check) *)
6788

6889
val to_slice : t -> CCByte_slice.t
6990
(** [to_slice buf] returns a slice of the current content.
70-
The slice shares the same byte array as [buf] (until [buf] is resized). *)
91+
The slice shares the same byte array as [buf] (until [buf] is resized).
92+
@since NEXT_RELEASE *)
7193

7294
val contents : t -> string
7395
(** Copy the internal data to a string. Allocates. *)
@@ -76,7 +98,12 @@ val contents_bytes : t -> bytes
7698
(** Copy the internal data to a {!bytes}. Allocates. *)
7799

78100
val iter : (char -> unit) -> t -> unit
101+
(** Iterate on the content *)
102+
79103
val iteri : (int -> char -> unit) -> t -> unit
104+
(** Iterate with index.
105+
@since NEXT_RELEASE *)
106+
80107
val fold_left : ('a -> char -> 'a) -> 'a -> t -> 'a
81108
val of_iter : char iter -> t
82109
val of_seq : char Seq.t -> t

0 commit comments

Comments
 (0)