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

Method GetKey

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

Source from the content-addressed store, hash-verified

209}
210
211bool CJsonObject::GetKey(std::string& strKey)
212{
213 if (IsArray())
214 {
215 return(false);
216 }
217 if (m_pKeyTravers == NULL)
218 {
219 if (m_pJsonData != NULL)
220 {
221 m_pKeyTravers = m_pJsonData;
222 }
223 else if (m_pExternJsonDataRef != NULL)
224 {
225 m_pKeyTravers = m_pExternJsonDataRef;
226 }
227 return(false);
228 }
229 else if (m_pKeyTravers == m_pJsonData || m_pKeyTravers == m_pExternJsonDataRef)
230 {
231 cJSON *c = m_pKeyTravers->child;
232 if (c)
233 {
234 strKey = c->string;
235 m_pKeyTravers = c->next;
236 return(true);
237 }
238 else
239 {
240 return(false);
241 }
242 }
243 else
244 {
245 strKey = m_pKeyTravers->string;
246 m_pKeyTravers = m_pKeyTravers->next;
247 return(true);
248 }
249}
250
251void CJsonObject::ResetTraversing()
252{

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected