feat(config): Inheritance

Add support for basic inheritance. The parser will
look for `inherit = base/section` and copy all undefined
values from the base section.

Ref 
This commit is contained in:
Michael Carlberg 2016-12-01 07:54:45 +01:00
parent 4f76d917f8
commit 0c6937edae
2 changed files with 44 additions and 0 deletions
include/components

View file

@ -24,9 +24,12 @@ DEFINE_ERROR(key_error);
class config {
public:
static constexpr const char* KEY_INHERIT{"inherit"};
explicit config(const logger& logger, const xresource_manager& xrm) : m_logger(logger), m_xrm(xrm) {}
void load(string file, string barname);
void copy_inherited();
string filepath() const;
string bar_section() const;
vector<string> defined_bars() const;