def __init__(self, is_compressed, phys_size, real_size_packer, underlying): """ :is_comprseed: contextual to determine if compressed :phys_size: contextual of physical size :real_size_pkr: packer to unpack "real_size" of compressed data (if compressed) if not compressed identical to ByteLimitedRange """ self.is_compressed = _contextify(is_compressed) self.phys_size = _contextify(phys_size) self.real_size_packer = real_size_packer self.underlying = underlying
def __init__(self, expr): SymmetricAdapter.__init__(self, noop) self.expr = _contextify(expr)
def __init__(self, length, padchar = six.b("\x00"), strict = False): self.length = _contextify(length) self.padchar = padchar self.strict = strict Adapter.__init__(self, Raw(self.length))
def If(cond, thenpkr, elsepkr): return Switch(lambda ctx, cond = _contextify(cond): bool(cond(ctx)), {True : thenpkr, False : elsepkr})
def __init__(self, size, itempkr, strict=False): self.size = _contextify(size) self.itempkr = itempkr self.strict = strict
def __init__(self, size): self.getsize = _contextify(size)
def __init__(self, length, padchar=six.b("\x00"), strict=False): self.length = _contextify(length) self.padchar = padchar self.strict = strict Adapter.__init__(self, Raw(self.length))