----------------------------------------------------------------------------- Obtain the name of the current element's first attribute -----------------------------------------------------------------------------
| 627 | // Obtain the name of the current element's first attribute |
| 628 | // ----------------------------------------------------------------------------- |
| 629 | const char* SimXMLDocument::firstAttribute() |
| 630 | { |
| 631 | // Get the current element |
| 632 | if(m_paNode.empty()) |
| 633 | { |
| 634 | return StringTable->EmptyString(); |
| 635 | } |
| 636 | const S32 iLastElement = m_paNode.size() - 1; |
| 637 | tinyxml2::XMLElement* pNode = m_paNode[iLastElement]->ToElement(); |
| 638 | if(!pNode) |
| 639 | { |
| 640 | return StringTable->EmptyString(); |
| 641 | } |
| 642 | |
| 643 | // Gets its first attribute, if any |
| 644 | m_CurrentAttribute = pNode->FirstAttribute(); |
| 645 | if(!m_CurrentAttribute) |
| 646 | { |
| 647 | return StringTable->EmptyString(); |
| 648 | } |
| 649 | |
| 650 | return m_CurrentAttribute->Name(); |
| 651 | } |
| 652 | |
| 653 | DefineEngineMethod( SimXMLDocument, firstAttribute, const char*, (),, |
| 654 | "@brief Obtain the name of the current Element's first attribute.\n\n" |
no test coverage detected