| 84 | } |
| 85 | |
| 86 | int CicadaJSONItem::getInt(const std::string &name, int defaultValue) const |
| 87 | { |
| 88 | if (nullptr == mJSON) { |
| 89 | return defaultValue; |
| 90 | } |
| 91 | |
| 92 | if (cJSON_HasObjectItem(mJSON, name.c_str())) { |
| 93 | return cJSON_GetObjectItem(mJSON, name.c_str())->valueint; |
| 94 | } |
| 95 | |
| 96 | if (cJSON_HasObjectItem(mJSON, name.c_str())) { |
| 97 | return cJSON_GetObjectItem(mJSON, name.c_str())->valuedouble; |
| 98 | } |
| 99 | |
| 100 | return defaultValue; |
| 101 | } |
| 102 | |
| 103 | int64_t CicadaJSONItem::getInt64(const std::string &name, int64_t defaultValue) const |
| 104 | { |
no test coverage detected