MCPcopy Create free account
hub / github.com/TorqueGameEngines/Torque3D / pushFirstChildElement

Method pushFirstChildElement

Engine/source/console/SimXMLDocument.cpp:344–376  ·  view source on GitHub ↗

----------------------------------------------------------------------------- Get true if first child element was successfully pushed onto stack. -----------------------------------------------------------------------------

Source from the content-addressed store, hash-verified

342// Get true if first child element was successfully pushed onto stack.
343// -----------------------------------------------------------------------------
344bool SimXMLDocument::pushFirstChildElement(const char* rName)
345{
346 // Clear the current attribute pointer
347 m_CurrentAttribute = 0;
348
349 // Push the first element found under the current element of the given name
350 tinyxml2::XMLElement* pElement;
351 if(!m_paNode.empty())
352 {
353 const S32 iLastElement = m_paNode.size() - 1;
354 tinyxml2::XMLNode* pNode = m_paNode[iLastElement];
355 if(!pNode)
356 {
357 return false;
358 }
359 pElement = pNode->FirstChildElement(rName);
360 }
361 else
362 {
363 if(!m_qDocument)
364 {
365 return false;
366 }
367 pElement = m_qDocument->FirstChildElement(rName);
368 }
369
370 if(!pElement)
371 {
372 return false;
373 }
374 m_paNode.push_back(pElement);
375 return true;
376}
377
378DefineEngineMethod( SimXMLDocument, pushFirstChildElement, bool, ( const char* name ),,
379 "@brief Push the first child Element with the given name onto the stack, making it the current Element.\n\n"

Callers 2

SimXMLDocument.cppFile · 0.80
readMethod · 0.80

Calls 4

FirstChildElementMethod · 0.80
emptyMethod · 0.45
sizeMethod · 0.45
push_backMethod · 0.45

Tested by

no test coverage detected