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