summaryrefslogtreecommitdiff
path: root/src/config.hh
diff options
context:
space:
mode:
authorJoel Klinghed <the_jk@yahoo.com>2015-06-04 00:22:57 +0200
committerJoel Klinghed <the_jk@yahoo.com>2015-06-04 00:22:57 +0200
commita6dfc269d93cdf557f6dac62b03b886d694faecd (patch)
tree8f9c04a4200a99fc4e986f1b0b23808040580011 /src/config.hh
parent052a162715449252bb6126c41dd1700b1440c394 (diff)
Add config and change all commands to one
Diffstat (limited to 'src/config.hh')
-rw-r--r--src/config.hh29
1 files changed, 29 insertions, 0 deletions
diff --git a/src/config.hh b/src/config.hh
new file mode 100644
index 0000000..6ea3607
--- /dev/null
+++ b/src/config.hh
@@ -0,0 +1,29 @@
+#ifndef CONFIG_HH
+#define CONFIG_HH
+
+#include <memory>
+#include <string>
+
+namespace stuff {
+
+class Config {
+public:
+ virtual ~Config() {}
+
+ virtual std::string get(const std::string& name,
+ const std::string& fallback) const = 0;
+ virtual bool load(const std::string& path) = 0;
+
+ static std::unique_ptr<Config> create();
+
+protected:
+ Config() {}
+
+private:
+ Config(const Config&) = delete;
+ Config& operator=(const Config&) = delete;
+};
+
+} // namespace stuff
+
+#endif /* CONFIG_HH */