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

Method attributeExists

Engine/source/console/SimXMLDocument.cpp:597–616  ·  view source on GitHub ↗

----------------------------------------------------------------------------- Get true if given attribute exists. -----------------------------------------------------------------------------

Source from the content-addressed store, hash-verified

595// Get true if given attribute exists.
596// -----------------------------------------------------------------------------
597bool SimXMLDocument::attributeExists(const char* rAttribute)
598{
599 if(m_paNode.empty())
600 {
601 return false;
602 }
603 const S32 iLastElement = m_paNode.size() - 1;
604 tinyxml2::XMLElement* pNode = m_paNode[iLastElement]->ToElement();
605 if(!pNode)
606 {
607 return false;
608 }
609
610 if(!pNode->Attribute(rAttribute))
611 {
612 return false;
613 }
614
615 return true;
616}
617
618DefineEngineMethod( SimXMLDocument, attributeExists, bool, ( const char* attributeName ),,
619 "@brief Tests if the requested attribute exists.\n\n"

Callers 1

SimXMLDocument.cppFile · 0.80

Calls 3

AttributeMethod · 0.80
emptyMethod · 0.45
sizeMethod · 0.45

Tested by

no test coverage detected