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

Method pushNewElement

Engine/source/console/SimXMLDocument.cpp:939–962  ·  view source on GitHub ↗

----------------------------------------------------------------------------- Create a new element and set to child of current stack element. New element is placed on top of element stack. -----------------------------------------------------------------------------

Source from the content-addressed store, hash-verified

937// New element is placed on top of element stack.
938// -----------------------------------------------------------------------------
939void SimXMLDocument::pushNewElement(const char* rName)
940{
941 tinyxml2::XMLElement* cElement = m_qDocument->NewElement( rName );
942 tinyxml2::XMLNode* pStackTop = 0;
943 if(m_paNode.empty())
944 {
945 pStackTop = m_qDocument->InsertEndChild(cElement);
946 }
947 else
948 {
949 const S32 iFinalElement = m_paNode.size() - 1;
950 tinyxml2::XMLNode *pNode = m_paNode[iFinalElement];
951 if(!pNode)
952 {
953 return;
954 }
955 pStackTop = pNode->InsertEndChild( cElement );
956 }
957 if(!pStackTop)
958 {
959 return;
960 }
961 m_paNode.push_back(pStackTop);
962}
963
964DefineEngineMethod( SimXMLDocument, pushNewElement, void, ( const char* name ),,
965 "@brief Create a new element with the given name as child of current Element "

Callers 10

SimXMLDocument.cppFile · 0.80
exportFunctionFunction · 0.80
exportTypeFunction · 0.80
exportScopeFunction · 0.80
exportBaseTypesMethod · 0.80
exportEntryTypesMethod · 0.80
exportNamespacesMethod · 0.80
exportXMLMethod · 0.80
writeMethod · 0.80
buildDocumentMethod · 0.80

Calls 5

NewElementMethod · 0.80
InsertEndChildMethod · 0.80
emptyMethod · 0.45
sizeMethod · 0.45
push_backMethod · 0.45

Tested by

no test coverage detected