------------------------------------------------------------------------------
| 119 | |
| 120 | //------------------------------------------------------------------------------ |
| 121 | bool GetFloatArray(const nlohmann::json& root, const std::string& key, std::vector<float>& value) |
| 122 | { |
| 123 | auto it = root.find(key); |
| 124 | if (it == root.end() || !it.value().is_array()) |
| 125 | { |
| 126 | return false; |
| 127 | } |
| 128 | value.reserve(it.value().size()); |
| 129 | for (const auto& floatValue : it.value()) |
| 130 | { |
| 131 | if (floatValue.empty() && !floatValue.is_number()) |
| 132 | { |
| 133 | value.clear(); |
| 134 | return false; |
| 135 | } |
| 136 | value.push_back(floatValue); |
| 137 | } |
| 138 | if (value.empty()) |
| 139 | { |
| 140 | value.clear(); |
| 141 | return false; |
| 142 | } |
| 143 | return true; |
| 144 | } |
| 145 | |
| 146 | //------------------------------------------------------------------------------ |
| 147 | bool GetDoubleArray(const nlohmann::json& root, const std::string& key, std::vector<double>& value) |