use ffi;
#[derive(Clone, Debug, Eq, PartialEq)]
pub struct Floorplan {
pub elements: Vec<FloorplanElement>,
}
#[derive(Clone, Debug, Eq, PartialEq)]
pub struct FloorplanElement {
pub id: String,
}
pub unsafe fn new(raw: &ffi::Floorplan_t) -> Floorplan {
let mut elements = vec![];
let mut cursor = raw.ElementsList.First;
for _ in 0..raw.ElementsList.Size {
assert!(!cursor.is_null());
elements.push(new_element(&(*cursor).Data));
cursor = (*cursor).Next;
}
Floorplan { elements: elements }
}
unsafe fn new_element(raw: &ffi::FloorplanElement_t) -> FloorplanElement {
FloorplanElement { id: c_str_to_string!(raw.Id) }
}