package slice
Install
dune-project
Dependency
Authors
Maintainers
Sources
sha256=503c4f74f67d16e30dd962a753ed3bca1469282c2202392f5b0e1b7e2a9b4562
sha512=2db7116df496c12892025b51b91cff87c739595e475eaa33b9a5bfcfbeb8a91cbe90da9b10d9408f41ccca9daec143d8ddf0099be2fac3f3330a3b3bfd25683e
doc/slice.bstr/Slice_bstr/index.html
Module Slice_bstrSource
get_int8 slice i is slice's signed 8-bit integer starting at byte index i.
get_uint8 slice i is slice's unsigned 8-bit integer starting at byte index i.
get_int16_ne slice i is slice's native-endian unsigned 16-bit integer starting at byte index i.
get_int16_le slice i is slice's little-endian unsigned 16-bit integer starting at byte index i.
get_int16_be slice i is slice's big-endian unsigned 16-bit integer starting at byte index i.
get_int16_ne slice i is slice's native-endian signed 16-bit integer starting at byte index i.
get_int16_le slice i is slice's little-endian signed 16-bit integer starting at byte index i.
get_int16_be slice i is slice's big-endian signed 16-bit integer starting at byte index i.
get_int32_ne slice i is slice's native-endian 32-bit integer starting at byte index i.
get_int32_le slice i is slice's little-endian 32-bit integer starting at byte index i.
get_int32_be slice i is slice's big-endian 32-bit integer starting at byte index i.
get_int64_ne slice i is slice's native-endian 64-bit integer starting at byte index i.
get_int64_le slice i is slice's little-endian 64-bit integer starting at byte index i.
get_int64_be slice i is slice's big-endian 64-bit integer starting at byte index i.
set t i chr modifies t in place, replacing the byte at index i with chr.
set_int8 t i v sets t's signed 8-bit integer starting at byte index i to v.
set_uint8 t i v sets t's unsigned 8-bit integer starting at byte index i to v.
set_uint16_ne t i v sets t's native-endian unsigned 16-bit integer starting at byte index i to v.
set_uint16_le t i v sets t's little-endian unsigned 16-bit integer starting at byte index i to v.
set_uint16_le t i v sets t's big-endian unsigned 16-bit integer starting at byte index i to v.
set_uint16_ne t i v sets t's native-endian signed 16-bit integer starting at byte index i to v.
set_uint16_le t i v sets t's little-endian signed 16-bit integer starting at byte index i to v.
set_uint16_le t i v sets t's big-endian signed 16-bit integer starting at byte index i to v.
set_int32_ne t i v sets t's native-endian 32-bit integer starting at byte index i to v.
set_int32_ne t i v sets t's little-endian 32-bit integer starting at byte index i to v.
set_int32_ne t i v sets t's big-endian 32-bit integer starting at byte index i to v.
set_int32_ne t i v sets t's native-endian 64-bit integer starting at byte index i to v.
set_int32_ne t i v sets t's little-endian 64-bit integer starting at byte index i to v.
set_int32_ne t i v sets t's big-endian 64-bit integer starting at byte index i to v.
blit_from_bytes src ~src_off dst ~dst_off ~len copies len bytes from byte sequence src, starting at index src_off, to slice dst, starting at index dst_off.
Just like blit_from_bytes, but the source is a slice and the destination is a bytes sequence.
fill t off len chr modifies t in place, replacing len characters with chr, starting at off.
sub slice ~off ~len does not allocate a new bigstring, but instead returns a new view into t.buf starting at off, and with length len.
Note that this does not allocate a new buffer, but instead shares the buffer of t.buf with the newly-returned slice.
shift slice n is sub slice n (length slice - n) (see sub for more details).
sub_string slice ~off ~len returns a string of length len containing the bytes of slice starting at off.
to_string slice is equivalent to sub_string slice ~off:0 ~len:(length slice).
of_string str returns a new t that contains the contents of the given string str.
string ~off ~len str is the sub-buffer of str that starts at position off (defaults to 0) and stops at position off + len (defaults to String.length str). str is fully-replaced by a fresh allocated t.