From 754ad0c6cbbbf62cd5e4aab299a3a895ebe9349c Mon Sep 17 00:00:00 2001 From: Matthias Beyer Date: Mon, 26 Oct 2015 23:56:54 +0100 Subject: [PATCH] Add store path configuration --- src/configuration.rs | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/configuration.rs b/src/configuration.rs index 3d15bcc3..17daa91f 100644 --- a/src/configuration.rs +++ b/src/configuration.rs @@ -11,6 +11,7 @@ use config::types::ScalarValue as S; pub struct Configuration { pub rtp : String, + pub store_sub : String, pub verbose : bool, pub debugging : bool, } @@ -22,6 +23,7 @@ impl Configuration { let mut verbose = false; let mut debugging = false; + let mut store_sub = String::from("/store"); if let Some(cfg) = fetch_config(&rtp) { if let Some(v) = cfg.lookup_boolean("verbose") { @@ -30,11 +32,15 @@ impl Configuration { if let Some(d) = cfg.lookup_boolean("debug") { debugging = d; } + if let Some(s) = cfg.lookup_str("store") { + store_sub = String::from(s); + } } Configuration { verbose: verbose, debugging: debugging, + store_sub: store_sub, rtp: rtp, } } @@ -47,6 +53,10 @@ impl Configuration { self.debugging } + pub fn store_path_str(&self) -> String { + format!("{}{}", self.rtp, self.store_sub) + } + } fn rtp_path(config: &Config) -> String {