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

Method attribute

Engine/source/console/SimXMLDocument.cpp:546–565  ·  view source on GitHub ↗

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

Source from the content-addressed store, hash-verified

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

Callers 2

SimXMLDocument.cppFile · 0.45
readLayerMethod · 0.45

Calls 4

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

Tested by

no test coverage detected