------------------------------------------------------------------------------
| 66 | |
| 67 | //------------------------------------------------------------------------------ |
| 68 | bool GetIntArray(const nlohmann::json& root, const std::string& key, std::vector<int>& value) |
| 69 | { |
| 70 | auto it = root.find(key); |
| 71 | if (it == root.end() || !it.value().is_array()) |
| 72 | { |
| 73 | return false; |
| 74 | } |
| 75 | value.reserve(it.value().size()); |
| 76 | for (const auto& intValue : it.value()) |
| 77 | { |
| 78 | if (intValue.empty() && !intValue.is_number_integer()) |
| 79 | { |
| 80 | value.clear(); |
| 81 | return false; |
| 82 | } |
| 83 | value.push_back(intValue); |
| 84 | } |
| 85 | if (value.empty()) |
| 86 | { |
| 87 | value.clear(); |
| 88 | return false; |
| 89 | } |
| 90 | return true; |
| 91 | } |
| 92 | |
| 93 | //------------------------------------------------------------------------------ |
| 94 | bool GetUIntArray( |