MCPcopy Create free account
hub / github.com/OpenDriveLab/OpenLane / Get

Method Get

eval/LANE_evaluation/lane2d/src/CJsonObject.cpp:675–707  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

673}
674
675bool CJsonObject::Get(const std::string& strKey, CJsonObject& oJsonObject) const
676{
677 cJSON* pJsonStruct = NULL;
678 if (m_pJsonData != NULL)
679 {
680 if (m_pJsonData->type == cJSON_Object)
681 {
682 pJsonStruct = cJSON_GetObjectItem(m_pJsonData, strKey.c_str());
683 }
684 }
685 else if (m_pExternJsonDataRef != NULL)
686 {
687 if(m_pExternJsonDataRef->type == cJSON_Object)
688 {
689 pJsonStruct = cJSON_GetObjectItem(m_pExternJsonDataRef, strKey.c_str());
690 }
691 }
692 if (pJsonStruct == NULL)
693 {
694 return(false);
695 }
696 char* pJsonString = cJSON_Print(pJsonStruct);
697 std::string strJsonData = pJsonString;
698 free(pJsonString);
699 if (oJsonObject.Parse(strJsonData))
700 {
701 return(true);
702 }
703 else
704 {
705 return(false);
706 }
707}
708
709bool CJsonObject::Get(const std::string& strKey, std::string& strValue) const
710{

Callers 1

read_lane_fileFunction · 0.80

Calls 4

cJSON_GetObjectItemFunction · 0.85
cJSON_PrintFunction · 0.85
cJSON_GetArrayItemFunction · 0.85
ParseMethod · 0.80

Tested by

no test coverage detected