|
rpm-build |
0f2925 |
(*
|
|
rpm-build |
0f2925 |
* ExtBuffer - extra functions over buffers.
|
|
rpm-build |
0f2925 |
* Copyright (C) 2014 Gabriel Scherer
|
|
rpm-build |
0f2925 |
*
|
|
rpm-build |
0f2925 |
* This library is free software; you can redistribute it and/or
|
|
rpm-build |
0f2925 |
* modify it under the terms of the GNU Lesser General Public
|
|
rpm-build |
0f2925 |
* License as published by the Free Software Foundation; either
|
|
rpm-build |
0f2925 |
* version 2.1 of the License, or (at your option) any later version,
|
|
rpm-build |
0f2925 |
* with the special exception on linking described in file LICENSE.
|
|
rpm-build |
0f2925 |
*
|
|
rpm-build |
0f2925 |
* This library is distributed in the hope that it will be useful,
|
|
rpm-build |
0f2925 |
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
rpm-build |
0f2925 |
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
rpm-build |
0f2925 |
* Lesser General Public License for more details.
|
|
rpm-build |
0f2925 |
*
|
|
rpm-build |
0f2925 |
* You should have received a copy of the GNU Lesser General Public
|
|
rpm-build |
0f2925 |
* License along with this library; if not, write to the Free Software
|
|
rpm-build |
0f2925 |
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
|
rpm-build |
0f2925 |
*)
|
|
rpm-build |
0f2925 |
|
|
rpm-build |
0f2925 |
(** Extra functions over text buffers.
|
|
rpm-build |
0f2925 |
|
|
rpm-build |
0f2925 |
We in fact provide the exact same interface as Buffer on 4.02 OCaml
|
|
rpm-build |
0f2925 |
versions, with the implementation for the 4.02-and-above
|
|
rpm-build |
0f2925 |
bytes-specific functions backported.
|
|
rpm-build |
0f2925 |
*)
|
|
rpm-build |
0f2925 |
|
|
rpm-build |
0f2925 |
open ExtBytes
|
|
rpm-build |
0f2925 |
|
|
rpm-build |
0f2925 |
module Buffer : sig
|
|
rpm-build |
0f2925 |
|
|
rpm-build |
0f2925 |
type t = Buffer.t
|
|
rpm-build |
0f2925 |
|
|
rpm-build |
0f2925 |
val create : int -> t
|
|
rpm-build |
0f2925 |
|
|
rpm-build |
0f2925 |
val contents : t -> string
|
|
rpm-build |
0f2925 |
|
|
rpm-build |
0f2925 |
val to_bytes : t -> Bytes.t
|
|
rpm-build |
0f2925 |
|
|
rpm-build |
0f2925 |
val sub : t -> int -> int -> string
|
|
rpm-build |
0f2925 |
|
|
rpm-build |
0f2925 |
val blit : t -> int -> Bytes.t -> int -> int -> unit
|
|
rpm-build |
0f2925 |
|
|
rpm-build |
0f2925 |
val nth : t -> int -> char
|
|
rpm-build |
0f2925 |
|
|
rpm-build |
0f2925 |
val length : t -> int
|
|
rpm-build |
0f2925 |
|
|
rpm-build |
0f2925 |
val clear : t -> unit
|
|
rpm-build |
0f2925 |
|
|
rpm-build |
0f2925 |
val reset : t -> unit
|
|
rpm-build |
0f2925 |
|
|
rpm-build |
0f2925 |
val add_char : t -> char -> unit
|
|
rpm-build |
0f2925 |
|
|
rpm-build |
0f2925 |
val add_string : t -> string -> unit
|
|
rpm-build |
0f2925 |
|
|
rpm-build |
0f2925 |
val add_bytes : t -> Bytes.t -> unit
|
|
rpm-build |
0f2925 |
|
|
rpm-build |
0f2925 |
val add_substring : t -> string -> int -> int -> unit
|
|
rpm-build |
0f2925 |
|
|
rpm-build |
0f2925 |
val add_subbytes : t -> Bytes.t -> int -> int -> unit
|
|
rpm-build |
0f2925 |
|
|
rpm-build |
0f2925 |
val add_substitute : t -> (string -> string) -> string -> unit
|
|
rpm-build |
0f2925 |
|
|
rpm-build |
0f2925 |
val add_buffer : t -> t -> unit
|
|
rpm-build |
0f2925 |
|
|
rpm-build |
0f2925 |
val add_channel : t -> in_channel -> int -> unit
|
|
rpm-build |
0f2925 |
|
|
rpm-build |
0f2925 |
val output_buffer : out_channel -> t -> unit
|
|
rpm-build |
0f2925 |
|
|
rpm-build |
0f2925 |
#if OCAML >= 405
|
|
rpm-build |
0f2925 |
|
|
rpm-build |
0f2925 |
val truncate : t -> int -> unit
|
|
rpm-build |
0f2925 |
|
|
rpm-build |
0f2925 |
#endif
|
|
rpm-build |
0f2925 |
|
|
rpm-build |
0f2925 |
#if OCAML >= 406
|
|
rpm-build |
0f2925 |
|
|
rpm-build |
0f2925 |
val add_utf_8_uchar : t -> Uchar.t -> unit
|
|
rpm-build |
0f2925 |
val add_utf_16le_uchar : t -> Uchar.t -> unit
|
|
rpm-build |
0f2925 |
val add_utf_16be_uchar : t -> Uchar.t -> unit
|
|
rpm-build |
0f2925 |
|
|
rpm-build |
0f2925 |
#endif
|
|
rpm-build |
0f2925 |
|
|
rpm-build |
0f2925 |
#if OCAML >= 407
|
|
rpm-build |
0f2925 |
(** [*_seq] functions were introduced in OCaml 4.07.0, and are _not_ implemented in extlib for older OCaml versions *)
|
|
rpm-build |
0f2925 |
val to_seq : t -> char Seq.t
|
|
rpm-build |
0f2925 |
val to_seqi : t -> (int * char) Seq.t
|
|
rpm-build |
0f2925 |
val add_seq : t -> char Seq.t -> unit
|
|
rpm-build |
0f2925 |
val of_seq : char Seq.t -> t
|
|
rpm-build |
0f2925 |
#endif
|
|
rpm-build |
0f2925 |
|
|
rpm-build |
0f2925 |
end
|