module Buffer:Nopres_intf.Bufferwith module Strategy = DefStrat and type el = char
Resizable buffer using the default reallocation strategy.
include Nopres_intf.T
Includes all functions that exist in non-parameterized arrays.
val sof_string : strategy -> string -> tsof_string s ar converts a string to a resizable buffer
using strategy s.
val of_string : string -> tof_string ar converts a string to a resizable buffer using
the default strategy.
Buffer-moduleNote that the function create n ignores the parameter n and
uses the default strategy instead. You can supply a different
strategy with creates s n as described above.
val contents : t -> stringcontents b
b.val reset : t -> unitreset b just clears the buffer, possibly resizing it.
val add_char : t -> char -> unitadd_char b c appends the character c at the end of
the buffer b.
val add_string : t -> string -> unitadd_string b s appends the string s at the end of
the buffer b.
val add_substring : t -> string -> int -> int -> unitadd_substring b s ofs len takes len characters from offset
ofs in string s and appends them at the end of the buffer
b.
val add_buffer : t -> t -> unitadd_buffer b1 b2 appends the current contents of buffer b2
at the end of buffer b1. b2 is not modified.
val add_channel : t -> Stdlib.in_channel -> int -> unitadd_channel b ic n reads exactly n character from the
input channel ic and stores them at the end of buffer b.
End_of_file if the channel contains fewer than n
characters.val output_buffer : Stdlib.out_channel -> t -> unitoutput_buffer oc b writes the current contents of buffer b
on the output channel oc.
val add_full_channel : t -> Stdlib.in_channel -> unit
val add_full_channel_f : t -> Stdlib.in_channel -> int -> (int -> int) -> unit