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

Method attribute

engine/source/persistence/SimXMLDocument.cpp:337–356  ·  view source on GitHub ↗

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

Source from the content-addressed store, hash-verified

335// Get attribute value if it exists.
336// -----------------------------------------------------------------------------
337const char* SimXMLDocument::attribute(const char* rAttribute)
338{
339 if(m_paNode.empty())
340 {
341 return StringTable->EmptyString;
342 }
343 const int iLastElement = m_paNode.size() - 1;
344 TiXmlElement* pNode = m_paNode[iLastElement];
345 if(!pNode)
346 {
347 return StringTable->EmptyString;
348 }
349
350 if(!pNode->Attribute(rAttribute))
351 {
352 return StringTable->EmptyString;
353 }
354
355 return pNode->Attribute(rAttribute);
356}
357
358// -----------------------------------------------------------------------------
359// Get true if given attribute exists.

Callers 1

Calls 3

AttributeMethod · 0.80
emptyMethod · 0.45
sizeMethod · 0.45

Tested by

no test coverage detected