------------------------------------------------------------------------------
| 145 | |
| 146 | //------------------------------------------------------------------------------ |
| 147 | bool GetDoubleArray(const nlohmann::json& root, const std::string& key, std::vector<double>& value) |
| 148 | { |
| 149 | auto it = root.find(key); |
| 150 | if (it == root.end() || !it.value().is_array()) |
| 151 | { |
| 152 | return false; |
| 153 | } |
| 154 | value.reserve(it.value().size()); |
| 155 | for (const auto& doubleValue : it.value()) |
| 156 | { |
| 157 | if (doubleValue.empty() && !doubleValue.is_number()) |
| 158 | { |
| 159 | value.clear(); |
| 160 | return false; |
| 161 | } |
| 162 | value.push_back(doubleValue); |
| 163 | } |
| 164 | if (value.empty()) |
| 165 | { |
| 166 | value.clear(); |
| 167 | return false; |
| 168 | } |
| 169 | return true; |
| 170 | } |
| 171 | |
| 172 | //------------------------------------------------------------------------------ |
| 173 | bool GetStringValue(const nlohmann::json& root, const std::string& key, std::string& value) |
no test coverage detected