----------------------------------------------------------------------------- Get attribute value if it exists. -----------------------------------------------------------------------------
| 335 | // Get attribute value if it exists. |
| 336 | // ----------------------------------------------------------------------------- |
| 337 | const 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. |
no test coverage detected