1use std::io::Cursor;
5
6use crate::ByteSpan;
7use binrw::BinRead;
8use binrw::binrw;
9
10#[binrw]
11#[derive(Debug)]
12#[brw(little)]
13struct SkpHeader {
14 magic: i32, #[br(count = 4)]
17 #[bw(pad_size_to = 4)]
18 #[bw(map = |x : &String | x.as_bytes())]
19 #[br(map = | x: Vec<u8> | String::from_utf8(x).unwrap().trim_matches(char::from(0)).to_string())]
20 pub version: String,
21}
22
23#[derive(Debug)]
24pub struct Skp {}
25
26impl Skp {
27 pub fn from_existing(buffer: ByteSpan) -> Option<Self> {
29 let mut cursor = Cursor::new(buffer);
30 SkpHeader::read(&mut cursor).ok()?;
31
32 Some(Skp {})
33 }
34}