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

feat: packfiledirectory #34

Draft
wants to merge 21 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
21 commits
Select commit Hold shift + click to select a range
d69a6a6
chore: engine package
UserIsntAvailable Nov 12, 2023
e7fac84
feat: implement the `core` traits to work with assets.
UserIsntAvailable Nov 12, 2023
f1a1f60
test(gamma_table): parse_works.
UserIsntAvailable Nov 13, 2023
efc53e4
chore: added todo about return types
nenikitov Nov 13, 2023
743160d
chore: trailling commas are annoying :/
UserIsntAvailable Nov 13, 2023
34fa0b2
chore: merge branch 'source-port' of https://github.com/nenikitov/ash…
UserIsntAvailable Nov 13, 2023
f3f41db
wip: initial `PackFileDirectory` implementation.
UserIsntAvailable Nov 13, 2023
0e18775
chore: add work-in-progres asset names
nenikitov Nov 13, 2023
90f02f5
chore: merge branch `main` into `feat/packfiledir`.
UserIsntAvailable Jan 17, 2024
36ba083
chore: remove dangling `Cargo.toml` from previous `lib` crate.
UserIsntAvailable Jan 17, 2024
399d7d7
chore: move `asset/directory` -> `asset/pack_file/directory`.
UserIsntAvailable Jan 17, 2024
23b79ce
chore: merge branch `main` into `feat/packfiledir`.
UserIsntAvailable Jan 27, 2024
388b2d3
refactor: move to non-"lazy" packfile directory.
UserIsntAvailable Jan 27, 2024
203de62
chore: merge branch `main` into `feat/packfiledir`.
UserIsntAvailable Jan 27, 2024
377f0b3
chore: merge branch `main` into `feat/packfiledir`.
UserIsntAvailable Oct 14, 2024
f4e44cf
chore: merge branch `main` into `feat/packfiledir`.
UserIsntAvailable Oct 15, 2024
69e3ec7
refactor: rewrite directory implementation.
UserIsntAvailable Oct 15, 2024
360298c
refactor: brainstorm recursive directories.
UserIsntAvailable Oct 15, 2024
8208750
refactor: more wip code.
UserIsntAvailable Oct 28, 2024
51fc305
refactor: simplify code
UserIsntAvailable Oct 30, 2024
3d94f6b
refactor: add simple clap cli.
UserIsntAvailable Oct 30, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
197 changes: 195 additions & 2 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

14 changes: 13 additions & 1 deletion ashen/src/asset/pack_file.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
//! This only works with the last version of Ashen :).

pub mod directory;

use crate::utils::nom::*;

#[derive(Debug, PartialEq)]
Expand All @@ -8,7 +10,7 @@
size: u32,
}

#[derive(Debug, PartialEq)]
#[derive(Debug, Default, PartialEq)]
pub struct EntryData {
bytes: Vec<u8>,
}
Expand All @@ -23,7 +25,7 @@
const HEADER: &'static str = "PMAN";
const COPYRIGHT_LENGTH: usize = 56;

pub fn new(input: &[u8]) -> Result<Self> {

Check warning on line 28 in ashen/src/asset/pack_file.rs

View workflow job for this annotation

GitHub Actions / clippy

docs for function returning `Result` missing `# Errors` section

warning: docs for function returning `Result` missing `# Errors` section --> ashen/src/asset/pack_file.rs:28:5 | 28 | pub fn new(input: &[u8]) -> Result<Self> { | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#missing_errors_doc
let (copyright, entries) = {
let (input, (copyright, total_entries)) = Self::header(input)?;
let (input, (headers)) = Self::entry_headers(input, total_entries)?;
Expand Down Expand Up @@ -84,6 +86,16 @@
}
}

impl PackFile {
fn copyright(&self) -> &str {
&self.copyright
}

fn into_raw_copyright(self) -> [u8; Self::COPYRIGHT_LENGTH] {
todo!()
}
}

#[cfg(test)]
mod tests {
use std::{cell::LazyCell, io, path::PathBuf};
Expand Down
Loading
Loading