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

Method pushNewElement

Engine/source/console/SimXMLDocument.cpp:918–943  ·  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

916// New element is placed on top of element stack.
917// -----------------------------------------------------------------------------
918void SimXMLDocument::pushNewElement(const char* rName)
919{
920 TiXmlElement cElement( rName );
921 TiXmlElement* pStackTop = 0;
922 if(m_paNode.empty())
923 {
924 pStackTop = dynamic_cast<TiXmlElement*>
925 (m_qDocument->InsertEndChild( cElement ) );
926 }
927 else
928 {
929 const S32 iFinalElement = m_paNode.size() - 1;
930 TiXmlElement* pNode = m_paNode[iFinalElement];
931 if(!pNode)
932 {
933 return;
934 }
935 pStackTop = dynamic_cast<TiXmlElement*>
936 (pNode->InsertEndChild( cElement ));
937 }
938 if(!pStackTop)
939 {
940 return;
941 }
942 m_paNode.push_back(pStackTop);
943}
944
945DefineEngineMethod( SimXMLDocument, pushNewElement, void, ( const char* name ),,
946 "@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 4

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

Tested by

no test coverage detected