module Bi_outbuf:sig
..end
type
t = {
|
mutable o_s : |
(* |
Buffer string
| *) |
|
mutable o_max_len : |
(* |
Same as
String.length s | *) |
|
mutable o_len : |
(* |
Length of the data present in the buffer = current position
in the buffer
| *) |
|
mutable o_offs : |
(* |
Length of data written and flushed out of the buffer.
The total number of bytes written to the buffer
is therefore
o_offs + o_len . | *) |
|
o_init_len : |
(* |
Initial length of the buffer
| *) |
|
o_make_room : |
(* | make_room buf n must provide space for at least the requested
number of bytes n , typically by reallocating a larger buffer
string or by flushing the data to a channel.
This function is only called when there is not enough space for n
bytes. | *) |
|
mutable : |
(* |
Hash table used to map shared objects to positions in the input stream.
| *) |
|
: |
(* |
Initial length of the
o_shared table. | *) |
val really_extend : t -> int -> unit
val flush_to_channel : Pervasives.out_channel -> t -> int -> unit
val create : ?make_room:(t -> int -> unit) -> ?shrlen:int -> int -> t
make_room
function is really_extend
.shrlen
: initial size of the table used to store shared values.val contents : t -> string
val create_channel_writer : ?len:int -> ?shrlen:int -> Pervasives.out_channel -> t
val flush_channel_writer : t -> unit
val create_output_writer : ?len:int ->
?shrlen:int -> < output : string -> int -> int -> int; .. > -> t
val flush_output_writer : t -> unit
val extend : t -> int -> unit
val alloc : t -> int -> int
alloc buf n
makes room for n
bytes and returns the position
of the first byte in the buffer string buf.s
.
It behaves as if n
arbitrary bytes were added and it is
the user's responsibility to set them to some meaningful values
by accessing buf.s
directly.val add_string : t -> string -> unit
val add_substring : t -> string -> int -> int -> unit
add_substring dst src srcpos len
copies len
bytes from
string src
to buffer dst
starting from position srcpos
.val add_char : t -> char -> unit
val add_char2 : t -> char -> char -> unit
val add_char4 : t -> char -> char -> char -> char -> unit
val unsafe_add_char : t -> char -> unit
val clear : t -> unit
val reset : t -> unit