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

Method KeyExist

CJsonObject.cpp:638–660  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

636}
637
638bool CJsonObject::KeyExist(const std::string& strKey) const
639{
640 cJSON* pJsonStruct = NULL;
641 if (m_pJsonData != NULL)
642 {
643 if (m_pJsonData->type == cJSON_Object)
644 {
645 pJsonStruct = cJSON_GetObjectItem(m_pJsonData, strKey.c_str());
646 }
647 }
648 else if (m_pExternJsonDataRef != NULL)
649 {
650 if(m_pExternJsonDataRef->type == cJSON_Object)
651 {
652 pJsonStruct = cJSON_GetObjectItem(m_pExternJsonDataRef, strKey.c_str());
653 }
654 }
655 if (pJsonStruct == NULL)
656 {
657 return(false);
658 }
659 return(true);
660}
661
662bool CJsonObject::Get(const std::string& strKey, CJsonObject& oJsonObject) const
663{

Callers 1

mainFunction · 0.80

Calls 1

cJSON_GetObjectItemFunction · 0.85

Tested by

no test coverage detected