mrcrowbar.views module

class mrcrowbar.views.LinearStore(parent: Block, source: Any, block_klass: type[Block], offsets: Any = None, sizes: Any = None, base_offset: int | Ref = 0, fill: bytes = b'x00', block_kwargs: dict[str, Any] | None = None, transform: Transform | None = None)[source]

Bases: mrcrowbar.views.View

base_offset
cache()[source]
items
offsets
save()[source]
sizes
source
validate()[source]
class mrcrowbar.views.Store(parent: Block, source: Any, fill: bytes = b'x00', base_offset: int = 0, align: int = 1)[source]

Bases: mrcrowbar.views.View

align
base_offset
cache()[source]
cache_object(instance, offset, size, block_klass, block_kwargs=None, transform=None)[source]
get_object(instance, offset, size)[source]
remove_object(instance, offset, size)[source]
save()[source]
set_object(instance, offset, size, value)[source]
source
class mrcrowbar.views.StoreRef(block_klass: type[Block], store: Store, offset: int, size: int | None = None, count: int | None = None, block_kwargs: dict[str, Any] | None = None, transform: Transform | None = None)[source]

Bases: mrcrowbar.refs.Ref

cache(instance: Block, name: str)[source]

Signal to the source to pre-load information.

Called by the parent Block constructor.

get(instance: Any)[source]

Return an attribute from an object using the Ref path.

instance
The object instance to traverse.
remove(instance: Any)[source]
set(instance: Any, value: Block)[source]

Set an attribute on an object using the Ref path.

instance
The object instance to traverse.
value
The value to set.

Throws AttributeError if allow_write is False.

class mrcrowbar.views.View(parent: Block)[source]

Bases: object

parent