2023-01-03 10:33:42 +00:00
|
|
|
#![allow(dead_code)]
|
2023-01-03 14:20:35 +00:00
|
|
|
mod entry;
|
2023-01-03 10:33:42 +00:00
|
|
|
mod error;
|
|
|
|
mod ext;
|
|
|
|
mod footer;
|
2023-01-03 14:20:35 +00:00
|
|
|
mod index;
|
|
|
|
mod pak;
|
2023-01-03 10:33:42 +00:00
|
|
|
|
2023-01-03 14:20:35 +00:00
|
|
|
pub use {entry::*, error::*, ext::*, footer::*, index::*, pak::*};
|
2023-01-03 10:33:42 +00:00
|
|
|
|
|
|
|
pub const MAGIC: u32 = 0x5A6F12E1;
|
|
|
|
|
|
|
|
#[repr(u32)]
|
|
|
|
#[derive(
|
|
|
|
Default,
|
|
|
|
Copy,
|
|
|
|
Clone,
|
|
|
|
PartialEq,
|
|
|
|
Eq,
|
|
|
|
PartialOrd,
|
|
|
|
Debug,
|
|
|
|
strum::Display,
|
|
|
|
strum::FromRepr,
|
|
|
|
strum::EnumIter,
|
|
|
|
)]
|
|
|
|
pub enum Version {
|
|
|
|
Unknown, // unknown (mostly just for padding :p)
|
|
|
|
Initial, // initial specification
|
|
|
|
NoTimestamps, // timestamps removed
|
|
|
|
CompressionEncryption, // compression and encryption support
|
|
|
|
IndexEncryption, // index encryption support
|
|
|
|
RelativeChunkOffsets, // offsets are relative to header
|
|
|
|
DeleteRecords, // record deletion support
|
|
|
|
EncryptionKeyGuid, // include key GUID
|
|
|
|
FNameBasedCompression, // compression names included
|
|
|
|
FrozenIndex, // frozen index byte included
|
|
|
|
#[default]
|
|
|
|
PathHashIndex, // more compression methods
|
|
|
|
}
|
|
|
|
|
2023-01-03 14:20:35 +00:00
|
|
|
// strum shouldn't need to be installed
|
2023-01-03 10:33:42 +00:00
|
|
|
impl Version {
|
|
|
|
pub fn iter() -> VersionIter {
|
|
|
|
<Version as strum::IntoEnumIterator>::iter()
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2023-01-03 14:20:35 +00:00
|
|
|
#[derive(Default, Copy, Clone, PartialEq, Eq, Debug, strum::Display, strum::EnumString)]
|
2023-01-03 10:33:42 +00:00
|
|
|
pub enum Compression {
|
2023-01-03 14:20:35 +00:00
|
|
|
#[default]
|
|
|
|
None,
|
2023-01-03 10:33:42 +00:00
|
|
|
Zlib,
|
2023-01-03 14:20:35 +00:00
|
|
|
ZlibBiasMemory,
|
|
|
|
ZlibBiasSpeed,
|
2023-01-03 10:33:42 +00:00
|
|
|
Gzip,
|
|
|
|
Oodle,
|
|
|
|
}
|