File tree Expand file tree Collapse file tree 1 file changed +36
-1
lines changed Expand file tree Collapse file tree 1 file changed +36
-1
lines changed Original file line number Diff line number Diff line change @@ -119,7 +119,42 @@ load(
119
119
120
120
// Config strings
121
121
c->configObj_ = toDomObject (s.configYaml );
122
-
122
+ c->settings_ .visit ([&c]<class T >(std::string_view name, T& value) {
123
+ if (!c->configObj_ .exists (name))
124
+ {
125
+ if constexpr (std::convertible_to<T, std::string_view>)
126
+ {
127
+ c->configObj_ .set (name, std::string (value));
128
+ }
129
+ else if constexpr (std::ranges::range<T>)
130
+ {
131
+ using ValueType = std::ranges::range_value_t <T>;
132
+ dom::Array arr;
133
+ for (auto const & v : value)
134
+ {
135
+ if constexpr (
136
+ std::is_same_v<ValueType, PathGlobPattern> ||
137
+ std::is_same_v<ValueType, SymbolGlobPattern>)
138
+ {
139
+ arr.emplace_back (v.pattern ());
140
+ }
141
+ else
142
+ {
143
+ arr.emplace_back (v);
144
+ }
145
+ }
146
+ c->configObj_ .set (name, std::move (arr));
147
+ }
148
+ else if constexpr (std::is_enum_v<T>)
149
+ {
150
+ c->configObj_ .set (name, to_string (value));
151
+ }
152
+ else
153
+ {
154
+ c->configObj_ .set (name, value);
155
+ }
156
+ }
157
+ });
123
158
return c;
124
159
}
125
160
You can’t perform that action at this time.
0 commit comments