Package lepl :: Package bin :: Module matchers
[hide private]
[frames] | no frames]

Module matchers

source code

Matchers specifically for binary data (most LEPL matchers can be used with binary data, but additional support is needed when the matching involves a literal comparison or generation of a binary result).
Classes [hide private]
  _Constant
Support class for matching constant values.
  Const
Match a given value, which is parsed as for BitString.from_int.
  _Variable
Support class for matching a given number of bits.
  _ByteArray
Support class for matching a given number of bytes.
  BEnd
Convert a given number of bits (multiple of 8) to a big-endian number.
  LEnd
Convert a given number of bits to a little-endian number.
  _String
Support class for reading a string.
Functions [hide private]
 
BitStr(value)
Match or read a bit string (to read a value, give the number of bits).
source code
 
Byte(value=None)
Match or read a byte (if a value is given, it must match).
source code
 
ByteArray(value)
Match or read an array of bytes (to read a value, give the number of bytes).
source code
 
_bint(length)
Factory method for big-endian values.
source code
 
_lint(length)
Factory method for little-endian values.
source code
 
String(value, encoding=None, errors=STRICT)
Match or read a string (to read a value, give the number of bytes).
source code
Variables [hide private]
  BInt16 = _bint(16)
Match or read an 16-bit big-endian integer (if a value is given, it must match).
  LInt16 = _lint(16)
Match or read an 16-bit little-endian integer (if a value is given, it must match).
  BInt32 = _bint(32)
Match or read an 32-bit big-endian integer (if a value is given, it must match).
  LInt32 = _lint(32)
Match or read an 32-bit little-endian integer (if a value is given, it must match).
  BInt64 = _bint(64)
Match or read an 64-bit big-endian integer (if a value is given, it must match).
  LInt64 = _lint(64)
Match or read an 64-bit little-endian integer (if a value is given, it must match).