]> xenbits.xensource.com Git - xcp/xen-api-libs.git/commitdiff
[stdext] Add the function Bigbuffer.append_string : Bigbuffer.t -> string -> unit
authorThomas Gazagnaire <thomas.gazagnaire@eu.citrix.com>
Mon, 11 Jan 2010 17:44:38 +0000 (17:44 +0000)
committerThomas Gazagnaire <thomas.gazagnaire@eu.citrix.com>
Mon, 11 Jan 2010 17:44:38 +0000 (17:44 +0000)
Signed-off-by: Thomas Gazagnaire <thomas.gazagnaire@citrix.com>
stdext/bigbuffer.ml
stdext/bigbuffer.mli

index 0445f564f257ebcc97a87b87032e575feda0ac3a..fec2e92abf18f264f42c6fcf03637c55cccb987b 100644 (file)
@@ -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
index 50eb3b2177a793f6646e403093d4509ae37812f0..b56764e0c58b191ae0e9ed755f2696e0cbead39c 100644 (file)
@@ -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