diff options
author | Bent Bisballe Nyeng <deva@aasimon.org> | 2023-01-11 19:57:00 +0100 |
---|---|---|
committer | Bent Bisballe Nyeng <deva@aasimon.org> | 2023-01-11 20:06:56 +0100 |
commit | 6af7742c35ecdf2831908443ca0e04bf23317a96 (patch) | |
tree | 9ada42d1d4b6bcb2618c1325f155429d2035808a /src/bootstrap.cc | |
parent | 648c89e879f739f82ed6dba7df7243e54b98601f (diff) |
Rename Configuation struct to configuration and make get/has functions member functions.
Diffstat (limited to 'src/bootstrap.cc')
-rw-r--r-- | src/bootstrap.cc | 16 |
1 files changed, 7 insertions, 9 deletions
diff --git a/src/bootstrap.cc b/src/bootstrap.cc index 09d6353..1fb3807 100644 --- a/src/bootstrap.cc +++ b/src/bootstrap.cc @@ -22,20 +22,18 @@ std::filesystem::path configurationFile("configuration.cc"); std::filesystem::path configHeaderFile("config.h"); -namespace ctor { -const Configuration default_configuration{}; -const Configuration& configuration() +const ctor::configuration default_configuration{}; +const ctor::configuration& ctor::get_configuration() { return default_configuration; } -bool hasConfiguration(const std::string& key) +bool ctor::configuration::has(const std::string& key) const { return false; } -const std::string& getConfiguration(const std::string& key, - const std::string& defaultValue) +const std::string& ctor::configuration::get(const std::string& key, const std::string& default_value) const { if(key == cfg::host_cxx && std::getenv("CXX")) { @@ -49,9 +47,8 @@ const std::string& getConfiguration(const std::string& key, return s; } - return defaultValue; + return default_value; } -} // namespace ctor:: int main(int argc, char* argv[]) { @@ -64,7 +61,8 @@ int main(int argc, char* argv[]) ctor::settings settings{}; - settings.builddir = ctor::getConfiguration(cfg::builddir, settings.builddir); + const auto& c = ctor::get_configuration(); + settings.builddir = c.get(cfg::builddir, settings.builddir); settings.parallel_processes = std::max(1u, std::thread::hardware_concurrency() * 2 - 1); settings.verbose = 0; |