use crate::util::{read_i32_le, read_u32_le};
#[derive(Clone, Copy, Debug)]
pub struct ImpInfo<'a> {
bytes: &'a [u8],
}
impl<'a> ImpInfo<'a> {
pub(crate) fn new(bytes: &'a [u8]) -> Self {
Self { bytes }
}
pub const SIZE: usize = 12;
#[inline]
pub fn flags(&self) -> u32 {
read_u32_le(self.bytes, 0x00).unwrap_or(0)
}
#[inline]
pub fn imp_file_offset(&self) -> i32 {
read_i32_le(self.bytes, 0x04).unwrap_or(-1)
}
#[inline]
pub fn guid_offset(&self) -> i32 {
read_i32_le(self.bytes, 0x08).unwrap_or(-1)
}
}