markedBlock: Create a markedBlock Object

Description Usage Arguments Details Value Author(s) See Also Examples

Description

This function creates a "markedBlock" object, which is a description of a block of binary data. This can be used as part of a description of a binary format.

Usage

1
2

Arguments

marker

A "memBlock" object.

switch

A function that returns a "memBlock" object.

Details

A "markedBlock" object describes a block of binary data that consists of a “marker” block containing information on further blocks. The marker block is read first, then this block is passed to the switch function. The switch function can look at the contents of the marker block and decide what sort of block should be read next. The result of the switch function is read from the end of the marker block. The marker block and the result of the switch function can be any type of "memBlock" object.

Value

A "markedBlock" object.

Author(s)

Paul Murrell

See Also

memFormat readFormat memBlock atomicBlock vectorBlock lengthBlock mixedBlock

Examples

1
2
3
4
5
6
# A single-byte integer which dictates how many
# subsequent four-byte reals to read
markedBlock(integer1,
            function(marker) {
              lengthBlock(real4, blockValue(marker))
            })


Search within the hexView package
Search all R packages, documentation and source code

Questions? Problems? Suggestions? or email at ian@mutexlabs.com.

Please suggest features or report bugs with the GitHub issue tracker.

All documentation is copyright its authors; we didn't write any of that.