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

Function ReadNumberOrStringValue

vkconfig_core/json.cpp:68–82  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

66}
67
68NumberOrString ReadNumberOrStringValue(const QJsonObject& json_object, const char* key) {
69 const QJsonValue& json_value = json_object.value(key);
70 assert(json_value != QJsonValue::Undefined);
71
72 NumberOrString value;
73 value.number = 0;
74
75 if (json_value.isString()) {
76 value.key = json_value.toString().toStdString();
77 } else {
78 value.number = json_value.toInt();
79 }
80
81 return value;
82}
83
84std::vector<std::string> ReadStringArray(const QJsonObject& json_object, const char* key) {
85 const QJsonValue& json_value = json_object.value(key);

Callers 1

LoadMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected