aboutsummaryrefslogtreecommitdiff
path: root/apps/cassiopeia/src/data.rs
diff options
context:
space:
mode:
authorMx Kookie <kookie@spacekookie.de>2020-12-11 13:38:58 +0000
committerMx Kookie <kookie@spacekookie.de>2020-12-21 05:19:49 +0100
commit5502c6d320f05f43239fc8e2b2839eb3fd5d742a (patch)
tree76f5d1d5685f6281789b4559db1bd257855b774b /apps/cassiopeia/src/data.rs
parentafd8a74e43fc57662381b16d418a559f471c80f5 (diff)
cassiopeia: implementing basic file parser
Diffstat (limited to 'apps/cassiopeia/src/data.rs')
-rw-r--r--apps/cassiopeia/src/data.rs29
1 files changed, 29 insertions, 0 deletions
diff --git a/apps/cassiopeia/src/data.rs b/apps/cassiopeia/src/data.rs
new file mode 100644
index 000000000000..8ebc67f016c5
--- /dev/null
+++ b/apps/cassiopeia/src/data.rs
@@ -0,0 +1,29 @@
+//! Typed time file for cassiopeia
+//!
+//! This data gets generated by the `format` module, and can later be
+//! used to generate new files, and perform various lookups and
+//! analysis tasks.
+
+use crate::format::LineCfg;
+use chrono::{Date, DateTime, FixedOffset as Offset};
+use std::collections::BTreeMap;
+
+#[derive(Default)]
+pub struct TimeFile {
+ header: BTreeMap<String, String>,
+ sessions: Vec<Session>,
+ invoices: Vec<Date<Offset>>,
+}
+
+impl TimeFile {
+ pub(crate) fn append(self, line: LineCfg) -> Self {
+ println!("{:?}", line);
+
+ self
+ }
+}
+
+pub struct Session {
+ start: DateTime<Offset>,
+ stop: DateTime<Offset>,
+}