Rope.BufferThis is similar to the Buffer module in the standard library except that it constructs ropes. It is recommended to use this module instead of repeatedly concatenating chars.
val create : int -> tcreate n returns a fresh buffer, initially empty. The n parameter is the initial size of the internal rope that holds the buffer contents. The buffer will grow dynamically to accomodate new inputs.
val clear : t -> unitEmpty the buffer.
val reset : t -> unitEmpty the buffer.
val length : t -> intReturn the number of characters currently contained in the buffer.
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_channel : t -> Stdlib.in_channel -> int -> unitadd_channel b ic n reads exactly n characters from the input channel ic and stores them at the end of buffer b.
add_buffer b1 b2 appends the current contents of buffer b2 at the end of buffer b1. b2 is not modified.
Return a copy of the current contents of the buffer. The buffer itself is unchanged.
sub b off len returns a rope of the current contents of the buffer b starting at offset off of length len bytes. The buffer itself is unaffected.
val nth : t -> int -> charnth b i returns the ith character if the buffer.