diff options
author | Karen Arutyunov <karen@codesynthesis.com> | 2018-12-07 23:12:05 +0300 |
---|---|---|
committer | Karen Arutyunov <karen@codesynthesis.com> | 2018-12-11 14:05:48 +0300 |
commit | 294c558d577cd4acb2ee8e94e0dfd6acdb946c6c (patch) | |
tree | 02742141dad6cf91040eb48eca54b718dee8ad55 /mod/mod-build-configs.cxx | |
parent | 7dabb6e931740b2777be5dca53c3cec0b984f0fb (diff) |
Add support for build configuration class inheritance
Diffstat (limited to 'mod/mod-build-configs.cxx')
-rw-r--r-- | mod/mod-build-configs.cxx | 25 |
1 files changed, 13 insertions, 12 deletions
diff --git a/mod/mod-build-configs.cxx b/mod/mod-build-configs.cxx index 99a092d..826bb87 100644 --- a/mod/mod-build-configs.cxx +++ b/mod/mod-build-configs.cxx @@ -11,7 +11,6 @@ #include <mod/page.hxx> #include <mod/options.hxx> -#include <mod/build-config.hxx> using namespace std; using namespace bbot; @@ -24,8 +23,8 @@ using namespace brep::cli; brep::build_configs:: build_configs (const build_configs& r) : handler (r), - options_ (r.initialized_ ? r.options_ : nullptr), - build_conf_ (r.initialized_ ? r.build_conf_ : nullptr) + build_config_module (r), + options_ (r.initialized_ ? r.options_ : nullptr) { } @@ -38,15 +37,7 @@ init (scanner& s) s, unknown_mode::fail, unknown_mode::fail); if (options_->build_config_specified ()) - try - { - build_conf_ = shared_build_config (options_->build_config ()); - } - catch (const io_error& e) - { - fail << "unable to read build configuration '" - << options_->build_config () << "': " << e; - } + build_config_module::init (static_cast<options::build> (*options_)); } bool brep::build_configs:: @@ -133,7 +124,17 @@ handle (request& rq, response& rs) { if (!classes.empty ()) classes += ' '; + classes += cls; + + // Append the base class, if present. + // + auto i (build_conf_->class_inheritance_map.find (cls)); + if (i != build_conf_->class_inheritance_map.end ()) + { + classes += ':'; + classes += i->second; + } } s << TABLE(CLASS="proplist config") |