Helper to get optional array of coordinates.
| 18 | |
| 19 | // Helper to get optional array of coordinates. |
| 20 | inline Coordinates parse_coordinates(const rapidjson::Value& object, |
| 21 | const char* key) { |
| 22 | if (!object[key].IsArray() || (object[key].Size() < 2) || |
| 23 | !object[key][0].IsNumber() || !object[key][1].IsNumber()) { |
| 24 | throw InputException("Invalid " + std::string(key) + " array."); |
| 25 | } |
| 26 | return {object[key][0].GetDouble(), object[key][1].GetDouble()}; |
| 27 | } |
| 28 | |
| 29 | inline std::string get_string(const rapidjson::Value& object, const char* key) { |
| 30 | std::string value; |
no test coverage detected