From: Thomas Gazagnaire Date: Mon, 11 Jan 2010 17:44:38 +0000 (+0000) Subject: [stdext] Add the function Bigbuffer.append_string : Bigbuffer.t -> string -> unit X-Git-Url: http://xenbits.xensource.com/gitweb?a=commitdiff_plain;h=1205aed0bd83597405025029a6bf868cd9e82577;p=xcp%2Fxen-api-libs.git [stdext] Add the function Bigbuffer.append_string : Bigbuffer.t -> string -> unit Signed-off-by: Thomas Gazagnaire --- diff --git a/stdext/bigbuffer.ml b/stdext/bigbuffer.ml index 0445f56..fec2e92 100644 --- a/stdext/bigbuffer.ml +++ b/stdext/bigbuffer.ml @@ -59,6 +59,8 @@ let rec append_substring bigbuf s offset len = ); () +let append_string b s = append_substring b s 0 (String.length s) + let to_fct bigbuf f = let array_offset = Int64.to_int (Int64.div bigbuf.index (Int64.of_int cell_size)) in let cell_offset = Int64.to_int (Int64.rem bigbuf.index (Int64.of_int cell_size)) in diff --git a/stdext/bigbuffer.mli b/stdext/bigbuffer.mli index 50eb3b2..b56764e 100644 --- a/stdext/bigbuffer.mli +++ b/stdext/bigbuffer.mli @@ -16,6 +16,10 @@ val make : unit -> t val length : t -> int64 val get : t -> int64 -> char val append_substring : t -> string -> int -> int -> unit + +(** [append_string b s] appends the string [x] to the big buffer [b] *) +val append_string : t -> string -> unit + val to_fct : t -> (string -> unit) -> unit val to_string : t -> string val to_stream : t -> out_channel -> unit