Skip to content
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

Merged
merged 17 commits into from
Apr 16, 2024
Merged

Entryfilelist parser #31

merged 17 commits into from
Apr 16, 2024

Conversation

vswarte
Copy link
Member

@vswarte vswarte commented Mar 17, 2024

No description provided.

@vswarte vswarte self-assigned this Mar 17, 2024
@vswarte vswarte marked this pull request as ready for review March 17, 2024 07:08
@vswarte vswarte requested a review from garyttierney as a code owner March 17, 2024 07:08
@github-actions github-actions bot enabled auto-merge March 17, 2024 07:41
}

#[allow(unused)]
pub struct EntryfilelistContainer<'a> {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
pub struct EntryfilelistContainer<'a> {
pub struct EntryFileListContainer<'a> {

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done per 3c9d315

self.header.decompressed_size.get() as usize
}

pub fn decompress(&self) -> Result<Entryfilelist, EntryfilelistError> {
Copy link
Collaborator

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?

Copy link
Member Author

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

fn seek_until_alignment(&mut self, alignment: usize) -> io::Result<usize>;
}

impl<T: Seek> SeekExt for T {
Copy link
Collaborator

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.

Copy link
Member Author

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)]
Copy link
Collaborator

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?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done per 3c9d315

@vswarte vswarte force-pushed the feat/entryfilelist-parser branch from 6cc38b7 to 3c9d315 Compare March 26, 2024 19:34
@vswarte vswarte requested a review from garyttierney April 14, 2024 18:08
Self: Sized;
}

impl<'a, TElement> Iterator for SectionIter<'a, TElement>
Copy link
Collaborator

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.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed per 99296a8

@vswarte vswarte requested a review from garyttierney April 15, 2024 19:41

fn next(&mut self) -> Option<Self::Item> {
if self.entries_read < self.entry_count {
let result = (self.entries_read..self.entry_count)
Copy link
Collaborator

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)
});

@vswarte vswarte force-pushed the feat/entryfilelist-parser branch from b26b412 to 41b6fd1 Compare April 16, 2024 01:24
@github-actions github-actions bot merged commit 472a67c into main Apr 16, 2024
6 checks passed
@github-actions github-actions bot deleted the feat/entryfilelist-parser branch April 16, 2024 01:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants