From a6dfc269d93cdf557f6dac62b03b886d694faecd Mon Sep 17 00:00:00 2001 From: Joel Klinghed Date: Thu, 4 Jun 2015 00:22:57 +0200 Subject: Add config and change all commands to one --- src/config.hh | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) create mode 100644 src/config.hh (limited to 'src/config.hh') 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 +#include + +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 create(); + +protected: + Config() {} + +private: + Config(const Config&) = delete; + Config& operator=(const Config&) = delete; +}; + +} // namespace stuff + +#endif /* CONFIG_HH */ -- cgit v1.2.3-70-g09d2