class documentation
class Reader(Mapping[
Constructor: Reader(file, max_entries, max_locstr)
Class to read and access an ERF archive (MOD, HAK, ERF, ...)
Example
>>> with open("Prelude.mod", "rb") as file: ... erf = Reader(file) ... print(erf.filenames) ... gff_data = erf.read_file("item.uti") ... ...
| Parameters | |
| file | The file object to read from, either a filename or a BinaryIO. |
| Class | |
Undocumented |
| Class | |
Undocumented |
| Method | __del__ |
Undocumented |
| Method | __getitem__ |
Undocumented |
| Method | __init__ |
Undocumented |
| Method | __iter__ |
Undocumented |
| Method | __len__ |
Undocumented |
| Method | read |
Retrieve the contents of a file from the archive. |
| Property | build |
The build date of the ERF archive. |
| Property | description |
The STRREF set in the ERF header. 0 if not set. |
| Property | file |
The file type of the ERF archive. |
| Property | filemap |
Returns the mapping of files. |
| Property | filenames |
Returns the filenames in the ERF archive. |
| Property | localized |
The localized strings in the ERF archive. |
| Class | _ |
Undocumented |
| Method | _seek |
Undocumented |
| Instance Variable | _file |
Undocumented |
| Instance Variable | _files |
Undocumented |
| Instance Variable | _header |
Undocumented |
| Instance Variable | _localized |
Undocumented |
| Instance Variable | _owns |
Undocumented |
| Instance Variable | _root |
Undocumented |
Retrieve the contents of a file from the archive.
| Parameters | |
filename:str | The name of the file to retrieve. |
| Returns | |
bytes | The contents of the file as a byte string. |
| Raises | |
KeyError | If the file is not found in the archive. |
ValueError | If the filename is of a unknown restype. |
Returns the mapping of files.
This method returns the internal dictionary that maps file names to their corresponding file data.
| Returns | |
| A dict mapping file names to their corresponding Entry objects. |