| 106 | } |
| 107 | |
| 108 | double CicadaJSONItem::getDouble(const std::string &name, double defaultValue) const |
| 109 | { |
| 110 | if (nullptr == mJSON) { |
| 111 | return defaultValue; |
| 112 | } |
| 113 | |
| 114 | if (cJSON_HasObjectItem(mJSON, name.c_str())) { |
| 115 | return cJSON_GetObjectItem(mJSON, name.c_str())->valuedouble; |
| 116 | } |
| 117 | |
| 118 | if (cJSON_HasObjectItem(mJSON, name.c_str())) { |
| 119 | return cJSON_GetObjectItem(mJSON, name.c_str())->valueint; |
| 120 | } |
| 121 | |
| 122 | return defaultValue; |
| 123 | } |
| 124 | |
| 125 | bool CicadaJSONItem::getBool(const std::string &name, bool defaultValue) const |
| 126 | { |
nothing calls this directly
no test coverage detected