-
Notifications
You must be signed in to change notification settings - Fork 3
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Entryfilelist parser #31
Conversation
crates/formats/src/entryfilelist.rs
Outdated
} | ||
|
||
#[allow(unused)] | ||
pub struct EntryfilelistContainer<'a> { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
pub struct EntryfilelistContainer<'a> { | |
pub struct EntryFileListContainer<'a> { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done per 3c9d315
crates/formats/src/entryfilelist.rs
Outdated
self.header.decompressed_size.get() as usize | ||
} | ||
|
||
pub fn decompress(&self) -> Result<Entryfilelist, EntryfilelistError> { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Grabbing all the strings alone is pushing the 500mb rn and its still not done
Is that in reference to this?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nope that's the size of the text file generated by entryfilelist-test when piped to a file
crates/formats/src/io_ext/seek.rs
Outdated
fn seek_until_alignment(&mut self, alignment: usize) -> io::Result<usize>; | ||
} | ||
|
||
impl<T: Seek> SeekExt for T { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd make this work over Read
and std::io::copy(&mut read.take(required), &mut std::io::sink())
so we can use this on readers that don't support seeking.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
65a45f6 removes it and replaces it with a call to read padding which I think is a bit better
use fstools_formats::entryfilelist::EntryfilelistContainer; | ||
|
||
#[derive(Parser, Debug)] | ||
#[command(version, about, long_about = None)] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you move this to a describe
command in the new CLI crate?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done per 3c9d315
6cc38b7
to
3c9d315
Compare
crates/formats/src/entryfilelist.rs
Outdated
Self: Sized; | ||
} | ||
|
||
impl<'a, TElement> Iterator for SectionIter<'a, TElement> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
T
is fine here, I think most people would figure out the T
is the element produced by the iterator.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed per 99296a8
crates/formats/src/entryfilelist.rs
Outdated
|
||
fn next(&mut self) -> Option<Self::Item> { | ||
if self.entries_read < self.entry_count { | ||
let result = (self.entries_read..self.entry_count) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
let result = (self.entries_read < self.entry_count).then(|| {
self.entries_read += 1;
T::read(&mut self.decoder)
});
b26b412
to
41b6fd1
Compare
No description provided.