MCPcopy Create free account
hub / github.com/alibaba/CicadaPlayer / getBool

Method getBool

framework/utils/CicadaJSON.cpp:125–137  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

123}
124
125bool 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
139std::string CicadaJSONItem::getStringOfObject(const std::string &name) const
140{

Callers

nothing calls this directly

Calls 2

cJSON_HasObjectItemFunction · 0.85
cJSON_GetObjectItemFunction · 0.85

Tested by

no test coverage detected