----------------------------------------------------------------------------- Create a new element and set to child of current stack element. New element is placed on top of element stack. -----------------------------------------------------------------------------
| 916 | // New element is placed on top of element stack. |
| 917 | // ----------------------------------------------------------------------------- |
| 918 | void 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 | |
| 945 | DefineEngineMethod( SimXMLDocument, pushNewElement, void, ( const char* name ),, |
| 946 | "@brief Create a new element with the given name as child of current Element " |
no test coverage detected