summaryrefslogtreecommitdiff
path: root/stdlib/buffer.mli
diff options
context:
space:
mode:
authorBasile Starynkevitch <basile.starynkevitch@inria.fr>2004-04-14 11:26:21 +0000
committerBasile Starynkevitch <basile.starynkevitch@inria.fr>2004-04-14 11:26:21 +0000
commit4281c5216b2857088e44b54a0a9c28974a7ecf9f (patch)
treef3d8b4f0ab6568d6cb0940bc16e76837c0d0b8fd /stdlib/buffer.mli
parent4041c97364a104f21394a42a79aa32f235f13106 (diff)
downloadocaml-4281c5216b2857088e44b54a0a9c28974a7ecf9f.tar.gz
added Buffer.sub & Buffer.nth
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@6203 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
Diffstat (limited to 'stdlib/buffer.mli')
-rw-r--r--stdlib/buffer.mli10
1 files changed, 10 insertions, 0 deletions
diff --git a/stdlib/buffer.mli b/stdlib/buffer.mli
index 73e02e299b..0448df7a38 100644
--- a/stdlib/buffer.mli
+++ b/stdlib/buffer.mli
@@ -40,6 +40,16 @@ val contents : t -> string
(** Return a copy of the current contents of the buffer.
The buffer itself is unchanged. *)
+val sub : t -> int -> int -> string
+(** [Buffer.sub b off len] returns (a copy of) the substring of the
+current contents of the buffer [b] starting at offset [off] of length
+[len] bytes. May raise {!Invalid_arg} if out of bounds request. The
+buffer itself is unaffected. *)
+
+val nth : t -> int -> char
+(** get the n-th character of the buffer. Raise {!Invalid_arg} if
+index out of bounds *)
+
val length : t -> int
(** Return the number of characters currently contained in the buffer. *)