package bap-dwarf

  1. Overview
  2. Docs

Buffer is a light abstraction over string and bigstring, that can allow one to share the same string for different sections without explicit copying.

type 'a t

create ~pos:0 creates a buffer from a data

val create : ?pos:int -> 'a -> 'a t

create ~pos:0 creates a buffer from a data

val with_pos : 'a t -> int -> 'a t

with_pos buf pos creates a new buffer that shares data with buf, but has different starting position

val with_off : 'a t -> int -> 'a t

with_off buf off creates a new buffer that shares data with buf, but has different starting position equal to pos buf + off

val pos : 'a t -> int

pos buf starting position

val data : 'a t -> 'a

data pos actual data.

Note: it doesn't start from pos, it start from 0

OCaml

Innovation. Community. Security.