1
Fork 0
mirror of https://github.com/redstrate/Physis.git synced 2025-04-26 06:07:45 +00:00

Document the two FileInfo functions

This commit is contained in:
Joshua Goins 2022-08-06 21:21:55 -04:00
parent 03f9df66d3
commit 753091f86f

View file

@ -41,11 +41,17 @@ pub struct FIINEntry {
}
impl FileInfo {
/// Parses an existing FIIN file.
pub fn from_existing(buffer : &MemoryBuffer) -> Option<FileInfo> {
let mut cursor = Cursor::new(buffer);
Some(FileInfo::read(&mut cursor).ok()?)
}
/// Creates a new FileInfo structure from a list of filenames. These filenames must be present in
/// the current working directory in order to be read properly, since it also generates SHA1
/// hashes.
///
/// The new FileInfo structure can then be serialized back into retail-compatible form.
pub fn new(file_names : Vec<&str>) -> Option<FileInfo> {
let mut entries = vec![];