changes...

This commit is contained in:
DJMrTV 2025-01-26 12:09:56 +01:00
commit 40ca10651f
18 changed files with 998 additions and 112 deletions

28
src/rmc/structures/any.rs Normal file
View file

@ -0,0 +1,28 @@
use std::io::{Read, Seek};
use crate::endianness::{IS_BIG_ENDIAN, ReadExtensions};
use super::{string, Result};
#[derive(Debug)]
pub struct Any{
pub name: String,
pub data: Vec<u8>
}
pub fn read(reader: &mut (impl Read + Seek)) -> Result<Any>{
let name = string::read(reader)?;
// also length ?
let len2: u32 = reader.read_struct(IS_BIG_ENDIAN)?;
let length: u32 = reader.read_struct(IS_BIG_ENDIAN)?;
let mut data = vec![0; length as usize];
reader.read_exact(&mut data)?;
Ok(
Any{
name,
data
}
)
}