| 123 | } |
| 124 | |
| 125 | bool CicadaJSONItem::getBool(const std::string &name, bool defaultValue) const |
| 126 | { |
| 127 | if (nullptr == mJSON) { |
| 128 | return defaultValue; |
| 129 | } |
| 130 | |
| 131 | if (cJSON_HasObjectItem(mJSON, name.c_str())) { |
| 132 | bool b = cJSON_GetObjectItem(mJSON, name.c_str())->valueint != 0; |
| 133 | return b; |
| 134 | } |
| 135 | |
| 136 | return defaultValue; |
| 137 | } |
| 138 | |
| 139 | std::string CicadaJSONItem::getStringOfObject(const std::string &name) const |
| 140 | { |
nothing calls this directly
no test coverage detected