CFBReader
Overview
CFBReader is a class in Aspose.Email FOSS for Python.
Reusable reader for Compound File Binary (CFB) containers.
Properties
| Name | Type | Access | Description |
|---|---|---|---|
data_size | int | Read | Is the total size of all stream data in the CFB file |
major_version | int | Read | Is the major version number from the CFB header |
sector_size | int | Read | Is the size in bytes of a standard sector |
mini_sector_size | int | Read | Is the size in bytes of a mini sector |
fat_sector_count | int | Read | Is the number of FAT sectors in the file |
directory_entry_count | int | Read | Is the total number of directory entries |
materialized_stream_count | int | Read | Is the count of streams whose data has been loaded |
file_size | int | Read | Is the total size in bytes of the CFB file on disk |
HEADER_LAYOUT | Dict[str, Tuple[int, int]] | Read | Represents the definition of header field offsets and sizes |
DIRECTORY_ENTRY_LAYOUT | Dict[str, Tuple[int, int]] | Read | Represents the definition of directory entry field offsets and sizes |
header | `` | Read | Contains the parsed header bytes of the CFB file |
difat | List[SectorNumber] | Read | Is the list of DIFAT sector numbers |
fat | List[int] | Read | Is the list of FAT sector indices |
mini_fat | List[int] | Read | |
directory_entries | `` | Read | Holds all parsed DirectoryEntry objects |
root_entry | `` | Read | Is the DirectoryEntry representing the root storage |
mini_stream | `` | Read | Is the raw byte content of the mini stream |
stream_data | Dict[StreamId, bytes] | Read | Maps StreamId to the loaded bytes of each stream |
Methods
| Signature | Description |
|---|---|
__init__(data: bytes | mmap.mmap, _mmap_owner: mmap.mmap | None) | |
from_file(path: Path | str) → "CFBReader" | Loads a CFB file from the given path and returns a CFBReader instance |
close() | Releases any resources associated with the opened CFB file |
get_entry(stream_id: StreamId) → DirectoryEntry | Returns the DirectoryEntry for the specified stream identifier |
get_stream_data(stream_id: StreamId) → bytes | Returns raw bytes of the stream identified by stream_id |
iter_storages() → Iterator[DirectoryEntry] | Yields DirectoryEntry objects representing storage entries |
iter_streams() → Iterator[DirectoryEntry] | Yields DirectoryEntry objects representing stream entries |
iter_children(storage_stream_id: StreamId) → Iterator[DirectoryEntry] | Yields child DirectoryEntry objects of the given storage |
iter_tree(start_stream_id: StreamId) → Iterator[Tuple[int, DirectoryEntry]] | Yield a depth-first tree traversal as (depth, entry) tuples. |
find_child_by_name(storage_stream_id: StreamId, name: str) → Optional[DirectoryEntry] | Searches for a child entry with the given name under a storage |
resolve_path(names: Iterable[str], start_stream_id: StreamId) → Optional[DirectoryEntry] | Resolve a storage/stream path by exact directory-entry names. |