------------------------------------------------------------------------------
| 92 | |
| 93 | //------------------------------------------------------------------------------ |
| 94 | bool GetUIntArray( |
| 95 | const nlohmann::json& root, const std::string& key, std::vector<unsigned int>& value) |
| 96 | { |
| 97 | auto it = root.find(key); |
| 98 | if (it == root.end() || !it.value().is_array()) |
| 99 | { |
| 100 | return false; |
| 101 | } |
| 102 | value.reserve(it.value().size()); |
| 103 | for (const auto& uIntValue : it.value()) |
| 104 | { |
| 105 | if (uIntValue.empty() && !uIntValue.is_number_unsigned()) |
| 106 | { |
| 107 | value.clear(); |
| 108 | return false; |
| 109 | } |
| 110 | value.push_back(uIntValue); |
| 111 | } |
| 112 | if (value.empty()) |
| 113 | { |
| 114 | value.clear(); |
| 115 | return false; |
| 116 | } |
| 117 | return true; |
| 118 | } |
| 119 | |
| 120 | //------------------------------------------------------------------------------ |
| 121 | bool GetFloatArray(const nlohmann::json& root, const std::string& key, std::vector<float>& value) |