----------------------------------------------------------------------------- Obtain the name of the current element's last attribute -----------------------------------------------------------------------------
| 664 | // Obtain the name of the current element's last attribute |
| 665 | // ----------------------------------------------------------------------------- |
| 666 | const char* SimXMLDocument::lastAttribute() |
| 667 | { |
| 668 | // Get the current element |
| 669 | if(m_paNode.empty()) |
| 670 | { |
| 671 | return StringTable->EmptyString(); |
| 672 | } |
| 673 | const S32 iLastElement = m_paNode.size() - 1; |
| 674 | tinyxml2::XMLElement* pNode = m_paNode[iLastElement]->ToElement(); |
| 675 | if(!pNode) |
| 676 | { |
| 677 | return StringTable->EmptyString(); |
| 678 | } |
| 679 | |
| 680 | // Gets its last attribute, if any |
| 681 | m_CurrentAttribute = pNode->FirstAttribute(); |
| 682 | while (m_CurrentAttribute->Next() != NULL) |
| 683 | { |
| 684 | m_CurrentAttribute = m_CurrentAttribute->Next(); |
| 685 | } |
| 686 | if(!m_CurrentAttribute) |
| 687 | { |
| 688 | return StringTable->EmptyString(); |
| 689 | } |
| 690 | |
| 691 | return m_CurrentAttribute->Name(); |
| 692 | } |
| 693 | |
| 694 | DefineEngineMethod( SimXMLDocument, lastAttribute, const char*, (),, |
| 695 | "@brief Obtain the name of the current Element's last attribute.\n\n" |
no test coverage detected