ireko/src/set_property.rs

37 lines
707 B
Rust
Raw Normal View History

use crate::Property;
use crate::common::read_string_with_length;
2025-02-19 19:34:13 -05:00
use binrw::binrw;
#[binrw]
#[derive(Debug)]
pub struct SetEntry {
#[br(parse_with = read_string_with_length)]
2025-02-19 19:34:13 -05:00
#[bw(ignore)]
pub unk_name: String,
#[br(parse_with = read_string_with_length)]
2025-02-19 19:34:13 -05:00
#[bw(ignore)]
pub unk_type: String,
#[br(args { magic: &unk_type })]
pub key: Property,
2025-02-19 19:34:13 -05:00
}
#[binrw]
#[derive(Debug)]
pub struct SetProperty {
pub unk: u32,
#[br(pad_before = 4, parse_with = read_string_with_length)]
2025-02-19 19:34:13 -05:00
#[bw(ignore)]
pub key_name: String,
#[br(pad_before = 5)]
pub num_set_entries: u32,
#[br(count = num_set_entries)]
2025-02-19 19:34:13 -05:00
pub entries: Vec<SetEntry>,
}
// TODO: write test