Adapter.maskedScanUint32Peek

Scan for pattern @pattern with applied mask @mask in the adapter data, starting from offset @offset. If a match is found, the value that matched is returned through @value, otherwise @value is left untouched.

The bytes in @pattern and @mask are interpreted left-to-right, regardless of endianness. All four bytes of the pattern must be present in the adapter for it to match, even if the first or last bytes are masked out.

It is an error to call this function without making sure that there is enough data (offset+size bytes) in the adapter.

class Adapter
ptrdiff_t
maskedScanUint32Peek
(
uint mask
,
uint pattern
,
size_t offset
,
size_t size
,
out uint value
)

Parameters

mask uint

mask to apply to data before matching against @pattern

pattern uint

pattern to match (after mask is applied)

offset size_t

offset into the adapter data from which to start scanning, returns the last scanned position.

size size_t

number of bytes to scan from offset

value uint

pointer to uint32 to return matching data

Return Value

Type: ptrdiff_t

offset of the first match, or -1 if no match was found.

Meta