| 71 | } |
| 72 | |
| 73 | const int GetIntNumber(const nlohmann::json &obj, const std::string &key, const int def) { |
| 74 | if(obj.is_object() && obj.contains(key) && obj[key].is_number_integer()) { |
| 75 | return obj[key].get<int>(); |
| 76 | } else { |
| 77 | return def; |
| 78 | } |
| 79 | } |
| 80 | |
| 81 | const float GetFloatNumber(const nlohmann::json &obj, const std::string &key, const float def) { |
| 82 | if(obj.is_object() && obj.contains(key) && obj[key].is_number()) { |
no outgoing calls
no test coverage detected