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

Method GetKey

CJsonObject.cpp:198–236  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

196}
197
198bool CJsonObject::GetKey(std::string& strKey)
199{
200 if (IsArray())
201 {
202 return(false);
203 }
204 if (m_pKeyTravers == NULL)
205 {
206 if (m_pJsonData != NULL)
207 {
208 m_pKeyTravers = m_pJsonData;
209 }
210 else if (m_pExternJsonDataRef != NULL)
211 {
212 m_pKeyTravers = m_pExternJsonDataRef;
213 }
214 return(false);
215 }
216 else if (m_pKeyTravers == m_pJsonData || m_pKeyTravers == m_pExternJsonDataRef)
217 {
218 cJSON *c = m_pKeyTravers->child;
219 if (c)
220 {
221 strKey = c->string;
222 m_pKeyTravers = c->next;
223 return(true);
224 }
225 else
226 {
227 return(false);
228 }
229 }
230 else
231 {
232 strKey = m_pKeyTravers->string;
233 m_pKeyTravers = m_pKeyTravers->next;
234 return(true);
235 }
236}
237
238void CJsonObject::ResetTraversing()
239{

Callers 1

mainFunction · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected