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

Method Load

vkconfig_core/setting_list.cpp:108–148  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

106}
107
108bool SettingMetaList::Load(const QJsonObject& json_setting) {
109 if (json_setting.value("list") != QJsonValue::Undefined) {
110 const QJsonArray& json_list_array = ReadArray(json_setting, "list");
111 for (int i = 0, n = json_list_array.size(); i < n; ++i) {
112 NumberOrString key;
113
114 if (json_list_array[i].isString()) {
115 key.key = json_list_array[i].toString().toStdString();
116 } else {
117 key.number = json_list_array[i].toInt();
118 }
119
120 this->list.push_back(key);
121 }
122 }
123
124 if (this->layer.key == "VK_LAYER_KHRONOS_validation" && this->key == "message_id_filter") {
125 ::LoadVUIDs(this->list);
126 }
127
128 std::sort(this->list.begin(), this->list.end());
129
130 if (json_setting.value("list_only") != QJsonValue::Undefined) {
131 this->list_only = ReadBoolValue(json_setting, "list_only");
132 }
133
134 const QJsonArray& json_default = ReadArray(json_setting, "default");
135 for (int i = 0, n = json_default.size(); i < n; ++i) {
136 const QJsonObject& json_object = json_default[i].toObject();
137
138 const NumberOrString& number_or_string = ReadNumberOrStringValue(json_object, "key");
139
140 EnabledNumberOrString enabled_string;
141 enabled_string.key = number_or_string.key;
142 enabled_string.number = number_or_string.number;
143 enabled_string.enabled = ReadBoolValue(json_object, "enabled");
144 this->default_value.push_back(enabled_string);
145 }
146
147 return true;
148}
149
150std::string SettingMetaList::Export(ExportMode export_mode) const {
151 (void)export_mode;

Callers

nothing calls this directly

Calls 4

ReadArrayFunction · 0.85
LoadVUIDsFunction · 0.85
ReadBoolValueFunction · 0.85
ReadNumberOrStringValueFunction · 0.85

Tested by

no test coverage detected