MCPcopy Create free account
hub / github.com/Bwar/CJsonObject / IsNull

Method IsNull

CJsonObject.cpp:948–974  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

946}
947
948bool CJsonObject::IsNull(const std::string& strKey) const
949{
950 cJSON* pJsonStruct = NULL;
951 if (m_pJsonData != NULL)
952 {
953 if (m_pJsonData->type == cJSON_Object)
954 {
955 pJsonStruct = cJSON_GetObjectItem(m_pJsonData, strKey.c_str());
956 }
957 }
958 else if (m_pExternJsonDataRef != NULL)
959 {
960 if(m_pExternJsonDataRef->type == cJSON_Object)
961 {
962 pJsonStruct = cJSON_GetObjectItem(m_pExternJsonDataRef, strKey.c_str());
963 }
964 }
965 if (pJsonStruct == NULL)
966 {
967 return(false);
968 }
969 if (pJsonStruct->type != cJSON_NULL)
970 {
971 return(false);
972 }
973 return(true);
974}
975
976bool CJsonObject::Add(const std::string& strKey, const CJsonObject& oJsonObject)
977{

Callers 1

mainFunction · 0.80

Calls 2

cJSON_GetObjectItemFunction · 0.85
cJSON_GetArrayItemFunction · 0.85

Tested by

no test coverage detected