#[repr(u8)]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
#[non_exhaustive]
pub enum BinaryType {
None = 0x00,
String = 0x01,
Int32 = 0x02,
Float = 0x03,
Ptr = 0x04,
WString = 0x05,
Color = 0x06,
UInt64 = 0x07,
ObjectEnd = 0x08,
}
impl BinaryType {
#[inline]
pub fn from_byte(b: u8) -> Option<Self> {
match b {
0x00 => Some(BinaryType::None),
0x01 => Some(BinaryType::String),
0x02 => Some(BinaryType::Int32),
0x03 => Some(BinaryType::Float),
0x04 => Some(BinaryType::Ptr),
0x05 => Some(BinaryType::WString),
0x06 => Some(BinaryType::Color),
0x07 => Some(BinaryType::UInt64),
0x08 => Some(BinaryType::ObjectEnd),
_ => None,
}
}
}
pub const APPINFO_MAGIC_40: u32 = 0x07564428;
pub const APPINFO_MAGIC_41: u32 = 0x07564429;
pub const PACKAGEINFO_MAGIC_BASE: u32 = 0x065655;
pub const PACKAGEINFO_MAGIC_39: u32 = 0x06565527;
pub const PACKAGEINFO_MAGIC_40: u32 = 0x06565528;