use std::ffi::OsString;
use std::path::PathBuf;
#[derive(Debug, Clone, Copy)]
pub struct FcaHeader {
pub entry_count: u32,
pub archive_ext_len: u32,
pub manifest_len: u32,
pub total_file_bytes: u64,
}
#[derive(Debug, Clone, Copy, PartialEq, Eq)]
pub enum ArchiveEntryKind {
File,
Directory,
}
#[derive(Debug, Clone)]
pub struct ArchiveEntry {
pub kind: ArchiveEntryKind,
pub path_utf8: String,
pub mode: u32,
pub size: u64,
pub source_path: Option<PathBuf>,
pub entry_ext: Vec<u8>,
}
#[derive(Debug, Clone)]
pub struct Manifest {
pub entries: Vec<ArchiveEntry>,
pub total_file_bytes: u64,
pub root_name: OsString,
pub root_is_file: bool,
pub root_mode: u32,
}
#[cfg(test)]
pub(crate) fn make_entry(path: &str, kind: ArchiveEntryKind, size: u64, mode: u32) -> ArchiveEntry {
ArchiveEntry {
kind,
path_utf8: path.to_string(),
mode,
size,
source_path: None,
entry_ext: Vec::new(),
}
}