summaryrefslogtreecommitdiff
path: root/src/cfg.cc
diff options
context:
space:
mode:
Diffstat (limited to 'src/cfg.cc')
-rw-r--r--src/cfg.cc16
1 files changed, 9 insertions, 7 deletions
diff --git a/src/cfg.cc b/src/cfg.cc
index 0196bde..b65246f 100644
--- a/src/cfg.cc
+++ b/src/cfg.cc
@@ -182,16 +182,18 @@ std::optional<bool> Config::get_bool(std::string_view name) const {
return std::nullopt;
}
-std::unique_ptr<Config> Config::load(std::string_view name,
- std::vector<std::string>& errors) {
- if (name.empty() || name.front() == '/') {
- auto ret = std::make_unique<ConfigSingleImpl>();
- ret->load(name, errors);
- return ret;
- }
+std::unique_ptr<Config> load_all(std::string_view name,
+ std::vector<std::string>& errors) {
auto ret = std::make_unique<ConfigXdgImpl>();
ret->load(name, errors);
return ret;
}
+std::unique_ptr<Config> load_one(std::filesystem::path const& path,
+ std::vector<std::string>& errors) {
+ auto ret = std::make_unique<ConfigSingleImpl>();
+ ret->load(path, errors);
+ return ret;
+}
+
} // namespace cfg