Skip to content

Commit

Permalink
(WIP) Update csv parser
Browse files Browse the repository at this point in the history
  • Loading branch information
kobkaz committed Dec 8, 2023
1 parent 8b1b49e commit 4e81195
Show file tree
Hide file tree
Showing 6 changed files with 309 additions and 96 deletions.
6 changes: 4 additions & 2 deletions tlmcmddb-csv/src/tlm.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ pub mod body;
mod filename;
pub mod metadata;
pub mod telemetry;
mod version;

pub use filename::Filename;

Expand All @@ -10,6 +11,7 @@ use std::io::Read;

pub fn parse_csv<R: Read>(telemetry_name: String, rdr: R) -> Result<tlmcmddb::tlm::Telemetry> {
let mut csv = crate::csv_reader_builder().from_reader(rdr);
let mut iter = csv.records();
telemetry::parse(telemetry_name, &mut iter)
let (version, mut iter) = version::guess(csv.records())?;

telemetry::parse(telemetry_name, &mut iter, version)
}
Loading

0 comments on commit 4e81195

Please sign in to comment.