summaryrefslogtreecommitdiffstats
path: root/imag-view
diff options
context:
space:
mode:
authorMatthias Beyer <mail@beyermatthias.de>2016-07-16 22:51:51 +0200
committerMatthias Beyer <mail@beyermatthias.de>2016-07-17 01:27:09 +0200
commitf50c54b6a4248e9ead96c45534cf8752de348628 (patch)
tree797998c2d6770b4173c570bce7768dacba8b1b17 /imag-view
parent98e0e5aaf54474770cea9dcf6dde10c1f0b88e20 (diff)
Add deps: log, toml
Diffstat (limited to 'imag-view')
-rw-r--r--imag-view/src/viewer/mod.rs16
-rw-r--r--imag-view/src/viewer/stdout.rs40
2 files changed, 0 insertions, 56 deletions
diff --git a/imag-view/src/viewer/mod.rs b/imag-view/src/viewer/mod.rs
deleted file mode 100644
index f7e3653f..00000000
--- a/imag-view/src/viewer/mod.rs
+++ /dev/null
@@ -1,16 +0,0 @@
-pub mod stdout;
-
-use libimagstore::store::FileLockEntry;
-
-pub struct ViewInformation<'a> {
- pub entry: FileLockEntry<'a>,
- pub view_header: bool,
- pub view_content: bool,
- pub view_copy: bool,
- pub keep_copy: bool,
-}
-
-pub trait Viewer {
- fn view(&self, vi: ViewInformation);
-}
-
diff --git a/imag-view/src/viewer/stdout.rs b/imag-view/src/viewer/stdout.rs
deleted file mode 100644
index 18536da6..00000000
--- a/imag-view/src/viewer/stdout.rs
+++ /dev/null
@@ -1,40 +0,0 @@
-use std::io::{Stdout, stdout};
-
-use toml::encode_str;
-
-use viewer::{ViewInformation, Viewer};
-
-pub struct StdoutViewer {
- out: Stdout,
-}
-
-impl StdoutViewer {
-
- pub fn new() -> StdoutViewer {
- StdoutViewer { out: stdout() }
- }
-
-}
-
-impl Viewer for StdoutViewer {
-
- fn view(&self, vi: ViewInformation) {
- if vi.view_copy {
- unimplemented!();
- }
-
- if vi.view_header {
- debug!("Going to display header: {:?}", vi.entry.get_header().header());
- println!("{}", encode_str(vi.entry.get_header().header()));
- }
-
- if vi.view_content {
- println!("{}", vi.entry.get_content());
- }
-
- if vi.view_copy && !vi.keep_copy {
- unimplemented!()
- }
- }
-
-}