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

Method lastAttribute

Engine/source/console/SimXMLDocument.cpp:664–686  ·  view source on GitHub ↗

----------------------------------------------------------------------------- Obtain the name of the current element's last attribute -----------------------------------------------------------------------------

Source from the content-addressed store, hash-verified

662// Obtain the name of the current element's last attribute
663// -----------------------------------------------------------------------------
664const char* SimXMLDocument::lastAttribute()
665{
666 // Get the current element
667 if(m_paNode.empty())
668 {
669 return StringTable->EmptyString();
670 }
671 const S32 iLastElement = m_paNode.size() - 1;
672 TiXmlElement* pNode = m_paNode[iLastElement];
673 if(!pNode)
674 {
675 return StringTable->EmptyString();
676 }
677
678 // Gets its last attribute, if any
679 m_CurrentAttribute = pNode->LastAttribute();
680 if(!m_CurrentAttribute)
681 {
682 return StringTable->EmptyString();
683 }
684
685 return m_CurrentAttribute->Name();
686}
687
688DefineEngineMethod( SimXMLDocument, lastAttribute, const char*, (),,
689 "@brief Obtain the name of the current Element's last attribute.\n\n"

Callers 1

SimXMLDocument.cppFile · 0.80

Calls 5

EmptyStringMethod · 0.80
LastAttributeMethod · 0.80
NameMethod · 0.80
emptyMethod · 0.45
sizeMethod · 0.45

Tested by

no test coverage detected