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

Method getInt

framework/utils/CicadaJSON.cpp:86–101  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

84}
85
86int 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
103int64_t CicadaJSONItem::getInt64(const std::string &name, int64_t defaultValue) const
104{

Callers 2

setScreenManualModeMethod · 0.80
invokeMethod · 0.80

Calls 2

cJSON_HasObjectItemFunction · 0.85
cJSON_GetObjectItemFunction · 0.85

Tested by

no test coverage detected