mirror of
https://github.com/redstrate/Physis.git
synced 2025-04-26 14:17:45 +00:00
Document the two FileInfo functions
This commit is contained in:
parent
03f9df66d3
commit
753091f86f
1 changed files with 6 additions and 0 deletions
|
@ -41,11 +41,17 @@ pub struct FIINEntry {
|
||||||
}
|
}
|
||||||
|
|
||||||
impl FileInfo {
|
impl FileInfo {
|
||||||
|
/// Parses an existing FIIN file.
|
||||||
pub fn from_existing(buffer : &MemoryBuffer) -> Option<FileInfo> {
|
pub fn from_existing(buffer : &MemoryBuffer) -> Option<FileInfo> {
|
||||||
let mut cursor = Cursor::new(buffer);
|
let mut cursor = Cursor::new(buffer);
|
||||||
Some(FileInfo::read(&mut cursor).ok()?)
|
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> {
|
pub fn new(file_names : Vec<&str>) -> Option<FileInfo> {
|
||||||
let mut entries = vec![];
|
let mut entries = vec![];
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue