| 636 | } |
| 637 | |
| 638 | bool 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 | |
| 662 | bool CJsonObject::Get(const std::string& strKey, CJsonObject& oJsonObject) const |
| 663 | { |
no test coverage detected