diff --git a/src/exd.rs b/src/exd.rs index 8abed58..78ddb54 100644 --- a/src/exd.rs +++ b/src/exd.rs @@ -185,7 +185,7 @@ pub struct EXD { pub rows: Vec, } -#[derive(Debug)] +#[derive(Debug, Clone)] pub enum ColumnData { String(String), Bool(bool), @@ -200,12 +200,12 @@ pub enum ColumnData { UInt64(u64), } -#[derive(Debug)] +#[derive(Debug, Clone)] pub struct ExcelSingleRow { pub columns: Vec, } -#[derive(Debug)] +#[derive(Debug, Clone)] pub enum ExcelRowKind { SingleRow(ExcelSingleRow), SubRows(Vec), @@ -222,6 +222,16 @@ impl EXD { EXD::read_args(&mut Cursor::new(&buffer), (exh,)).ok() } + pub fn get_row(&self, row_id: u32) -> Option { + for row in &self.rows { + if row.row_id == row_id { + return Some(row.kind.clone()); + } + } + + return None; + } + fn read_data_raw = ()>>(cursor: &mut T) -> Option { Z::read_options(cursor, Endian::Big, ()).ok() }