package binsec

  1. Overview
  2. Docs

doc/binsec.base/Binsec_base/Reader/index.html

Module Binsec_base.ReaderSource

Basic stream reader

Sourcetype nonrec int32 = int32
Sourcetype nonrec int64 = int64
Sourcetype endianness = Basic_types.endianness =
  1. | LittleEndian
  2. | BigEndian
Sourcetype 'a t

Constructors

Sourceval create : offset:('a -> int -> 'a) -> get:('b -> 'a -> char) -> ?endianness:endianness -> start:'a -> ?pos:'a -> stop:'a -> 'b -> 'a t
Sourceval of_bigarray : ?pos:int -> ?endianness:endianness -> (int, Bigarray.int8_unsigned_elt, Bigarray.c_layout) Bigarray.Array1.t -> int t
Sourceval of_zero_extend_bigarray : ?pos:int -> ?endianness:endianness -> dim:int -> (int, Bigarray.int8_unsigned_elt, Bigarray.c_layout) Bigarray.Array1.t -> int t
Sourceval of_nibbles : ?pos:int -> ?endianness:endianness -> string -> int t
Sourceval of_bytes : ?pos:int -> ?endianness:endianness -> string -> int t
Sourceval of_binstream : ?pos:int -> ?endianness:endianness -> Binstream.t -> int t
Sourceval rebase : offset:('a -> int -> 'a) -> distance:('a -> 'a -> int) -> 'a -> int t -> 'a t
Sourceval sub : 'a t -> int -> int t

Generic manipulation functions

Sourceval get_pos : int t -> int

get_pos r gets the delta between the start and the current position.

Sourceval set_pos : 'a t -> int -> unit

set_pos r n moves the cursor to the nth position from the start.

Sourceval move : 'a t -> 'a -> unit

move r p moves the cursor to position p.

Sourceval advance : 'a t -> int -> unit

advance r n moves the cursor by n bytes.

Sourceval rewind : 'a t -> int -> unit

rewind r n moves back the cursor by n bytes.

Sourceval get_endianness : 'a t -> endianness

get_endianness r gets the current reader endianness r

Sourceval set_endianness : 'a t -> endianness -> unit

set_endianness e r sets reader to report value w.r.t to endianness r

Sourceval dim : int t -> int
Sourceval at_end : 'a t -> bool
Sourceval ensure : 'a t -> int -> bool

Read functions

Sourcemodule type ACCESS = sig ... end