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

Method firstAttribute

Engine/source/console/SimXMLDocument.cpp:627–649  ·  view source on GitHub ↗

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

Source from the content-addressed store, hash-verified

625// Obtain the name of the current element's first attribute
626// -----------------------------------------------------------------------------
627const 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
651DefineEngineMethod( SimXMLDocument, firstAttribute, const char*, (),,
652 "@brief Obtain the name of the current Element's first attribute.\n\n"

Callers 1

SimXMLDocument.cppFile · 0.80

Calls 5

EmptyStringMethod · 0.80
FirstAttributeMethod · 0.80
NameMethod · 0.80
emptyMethod · 0.45
sizeMethod · 0.45

Tested by

no test coverage detected