MCPcopy Create free account
hub / github.com/LunarG/VulkanTools / FindSetting

Function FindSetting

vkconfig_core/setting.cpp:249–273  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

247}
248
249SettingMeta* FindSetting(SettingMetaSet& settings, const char* key) {
250 for (std::size_t i = 0, n = settings.size(); i < n; ++i) {
251 if (settings[i]->key == key) {
252 return settings[i];
253 }
254
255 SettingMeta* child = FindSetting(settings[i]->children, key);
256 if (child != nullptr) {
257 return child;
258 }
259
260 if (IsEnum(settings[i]->type) || IsFlags(settings[i]->type)) {
261 SettingMetaEnum& setting_meta_enum = static_cast<SettingMetaEnum&>(*settings[i]);
262
263 for (std::size_t j = 0, o = setting_meta_enum.enum_values.size(); j < o; ++j) {
264 SettingMeta* setting_meta = FindSetting(setting_meta_enum.enum_values[j].settings, key);
265 if (setting_meta != nullptr) {
266 return setting_meta;
267 }
268 }
269 }
270 }
271
272 return nullptr;
273}
274
275const SettingMeta* FindSetting(const SettingMetaSet& settings, const char* key) {
276 for (std::size_t i = 0, n = settings.size(); i < n; ++i) {

Callers 1

CheckDependenceFunction · 0.70

Calls 2

IsEnumFunction · 0.85
IsFlagsFunction · 0.85

Tested by

no test coverage detected