| 27 | } |
| 28 | |
| 29 | inline std::string get_string(const rapidjson::Value& object, const char* key) { |
| 30 | std::string value; |
| 31 | if (object.HasMember(key)) { |
| 32 | if (!object[key].IsString()) { |
| 33 | throw InputException("Invalid " + std::string(key) + " value."); |
| 34 | } |
| 35 | value = object[key].GetString(); |
| 36 | } |
| 37 | return value; |
| 38 | } |
| 39 | |
| 40 | inline double get_double(const rapidjson::Value& object, const char* key) { |
| 41 | double value = 1.; |
no test coverage detected