| 66 | } |
| 67 | |
| 68 | NumberOrString 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 | |
| 84 | std::vector<std::string> ReadStringArray(const QJsonObject& json_object, const char* key) { |
| 85 | const QJsonValue& json_value = json_object.value(key); |