pub struct Source<'a> {
pub folder: &'a Folder,
pub base: Option<&'a Folder>,
pub oodle: Option<&'a Oodle>,
}Expand description
A Patch folder with the game’s data behind it: files a Patch TOC places in the base game are read there, and CAS payloads are decoded with the game’s own Oodle when they use it.
Fields§
§folder: &'a FolderThe folder to read, which holds the TOCs asked about.
base: Option<&'a Folder>The game’s own Data folder, where folder is a Patch folder.
oodle: Option<&'a Oodle>The game’s Oodle library, for payloads that use it.
Implementations§
Source§impl Source<'_>
impl Source<'_>
Sourcepub fn raw(&self, f: FileRef) -> Result<Vec<u8>>
pub fn raw(&self, f: FileRef) -> Result<Vec<u8>>
The stored bytes of a file a bundle region points at, from the folder or the base game.
Sourcepub fn merged_toc(&self, rel: &str) -> Result<Toc>
pub fn merged_toc(&self, rel: &str) -> Result<Toc>
The superbundle TOC at rel (relative to the folder, as in Folder::tocs) as the game sees it: the folder’s
TOC merged with the base game’s TOC of the same path (toc::merge) when its flags say the base holds bundles or
chunks it lacks, else the folder’s TOC as it is. A flagged TOC the base game has no TOC for (a superbundle the
folder adds: 30 of the 199 flagged TOCs of the installed mods) stands alone. An error when the TOC is flagged
and the source has no base game folder.
Sourcepub fn payload(&self, f: FileRef, expected: usize) -> Result<Vec<u8>>
pub fn payload(&self, f: FileRef, expected: usize) -> Result<Vec<u8>>
A CAS-framed file decoded to exactly expected bytes.
Sourcepub fn manifest(
&self,
files: &[FileRef],
inline: &[u8],
) -> Result<Option<(Manifest, usize, Vec<u8>)>>
pub fn manifest( &self, files: &[FileRef], inline: &[u8], ) -> Result<Option<(Manifest, usize, Vec<u8>)>>
The bundle’s manifest and the index of its first asset file, read the way ReSkate’s merge reads it: inline in the region (its assets then no more than the region’s files), else the region file that is a manifest (raw or CAS-framed) whose asset count matches.
Sourcepub fn ebx(&self, toc: &str, name: &str) -> Result<(String, Document)>
pub fn ebx(&self, toc: &str, name: &str) -> Result<(String, Document)>
The EBX document named name (ASCII case-insensitive, as bundle manifests name them: characters/.../x) in
the first bundle of the TOC at toc (relative to the folder, as in Folder::tocs) that holds it, read; with
the bundle’s name. An error when no bundle of that TOC holds it.
Sourcepub fn ebx_index(
&self,
toc: &str,
bundle_name: &str,
) -> Result<BTreeMap<[u8; 16], EbxEntry>>
pub fn ebx_index( &self, toc: &str, bundle_name: &str, ) -> Result<BTreeMap<[u8; 16], EbxEntry>>
Every EBX document of the bundle named bundle_name in the TOC at toc, by its file GUID: its name and where
it lies (read it with Source::read_ebx). Each document’s payload is read for its GUID, not parsed.
Source§impl Source<'_>
impl Source<'_>
Sourcepub fn bundle_names(&self, toc: &str) -> Result<Vec<String>>
pub fn bundle_names(&self, toc: &str) -> Result<Vec<String>>
The bundles of the TOC at toc (relative to the data folder), by name, in stored order. Reads the TOC only.
Sourcepub fn bundle(&self, toc: &str, name: &str) -> Result<Bundle>
pub fn bundle(&self, toc: &str, name: &str) -> Result<Bundle>
The bundle named name (ASCII case-insensitive) of the TOC at toc.