MCPcopy Create free account
hub / github.com/Alexays/Waybar / findConfigPath

Method findConfigPath

src/config.cpp:68–86  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

66}
67
68std::optional<std::string> Config::findConfigPath(const std::vector<std::string>& names,
69 const std::vector<std::string>& dirs) {
70 if (const char* dir = std::getenv(Config::CONFIG_PATH_ENV)) {
71 for (const auto& name : names) {
72 if (auto res = tryExpandPath(dir, name); !res.empty()) {
73 return res.front();
74 }
75 }
76 }
77
78 for (const auto& dir : dirs) {
79 for (const auto& name : names) {
80 if (auto res = tryExpandPath(dir, name); !res.empty()) {
81 return res.front();
82 }
83 }
84 }
85 return std::nullopt;
86}
87
88void Config::setupConfig(Json::Value& dst, const std::string& config_file, int depth) {
89 if (depth > 100) {

Callers

nothing calls this directly

Calls 1

emptyMethod · 0.80

Tested by

no test coverage detected