diff options
author | schwente <sascha.schwenteck@hs-furtwangen.de> | 2016-05-31 13:34:50 +0200 |
---|---|---|
committer | schwente <sascha.schwenteck@hs-furtwangen.de> | 2016-05-31 13:34:50 +0200 |
commit | 03ee6e68384c9faeca4b7086b436cf9524c270cc (patch) | |
tree | b0c025721b6a8729e4ad7ab0600f1f7d456fc5b1 /libimagtodo | |
parent | 66e57bf57c2dbce6265ebbe4ba3ebb696acf582b (diff) |
Delete Function
Diffstat (limited to 'libimagtodo')
-rw-r--r-- | libimagtodo/src/delete.rs | 31 |
1 files changed, 31 insertions, 0 deletions
diff --git a/libimagtodo/src/delete.rs b/libimagtodo/src/delete.rs index e69de29b..cdb16501 100644 --- a/libimagtodo/src/delete.rs +++ b/libimagtodo/src/delete.rs @@ -0,0 +1,31 @@ +// Needed for reading a Json File +// extern crate rustc_serialize; +// use rustc_serialize::json::Json; +// use std::fs::File; +// use std::io::Read; + +use std::ops::Deref; +use toml::Value; + +use libimagstore::store::Store; +use libimagstore::storeid::IntoStoreId; +use module_path::ModuleEntryPath; + +/// With the uuid we get the storeid and than we can delete the entry +fn deleteFunc(uuid: i32, store : &Store) { + // With this we can read from a .json File + // let mut file = File::open("text.json").unwrap(); + // let mut data = String::new(); + // file.rad_to_string(&mut data).unwrap(); + // + // let jeson = Json::from_str(&data).unwrap(); + // println!("{}", json.find_path(&["uuid"]).unwrap()); + + // With the uuid we get the storeid + let store_id = ModuleEntryPath::new(format!("taskwarrior/{}", uuid)).into_storeid(); + // It deletes an entry + store.delete(store_id); + + println!("The {} was delete!", uuid); +} + |