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

Method attribute

Engine/source/console/SimXMLDocument.cpp:544–563  ·  view source on GitHub ↗

----------------------------------------------------------------------------- Get attribute value if it exists. -----------------------------------------------------------------------------

Source from the content-addressed store, hash-verified

542// Get attribute value if it exists.
543// -----------------------------------------------------------------------------
544const char* SimXMLDocument::attribute(const char* rAttribute)
545{
546 if(m_paNode.empty())
547 {
548 return StringTable->EmptyString();
549 }
550 const S32 iLastElement = m_paNode.size() - 1;
551 TiXmlElement* pNode = m_paNode[iLastElement];
552 if(!pNode)
553 {
554 return StringTable->EmptyString();
555 }
556
557 if(!pNode->Attribute(rAttribute))
558 {
559 return StringTable->EmptyString();
560 }
561
562 return pNode->Attribute(rAttribute);
563}
564
565DefineEngineMethod( SimXMLDocument, attribute, const char*, ( const char* attributeName ),,
566 "@brief Get a string attribute from the current Element on the stack.\n\n"

Callers 2

SimXMLDocument.cppFile · 0.80
readLayerMethod · 0.80

Calls 4

EmptyStringMethod · 0.80
AttributeMethod · 0.80
emptyMethod · 0.45
sizeMethod · 0.45

Tested by

no test coverage detected