----------------------------------------------------------------------------- Get true if first child element was successfully pushed onto stack. -----------------------------------------------------------------------------
| 342 | // Get true if first child element was successfully pushed onto stack. |
| 343 | // ----------------------------------------------------------------------------- |
| 344 | bool SimXMLDocument::pushFirstChildElement(const char* rName) |
| 345 | { |
| 346 | // Clear the current attribute pointer |
| 347 | m_CurrentAttribute = 0; |
| 348 | |
| 349 | // Push the first element found under the current element of the given name |
| 350 | tinyxml2::XMLElement* pElement; |
| 351 | if(!m_paNode.empty()) |
| 352 | { |
| 353 | const S32 iLastElement = m_paNode.size() - 1; |
| 354 | tinyxml2::XMLNode* pNode = m_paNode[iLastElement]; |
| 355 | if(!pNode) |
| 356 | { |
| 357 | return false; |
| 358 | } |
| 359 | pElement = pNode->FirstChildElement(rName); |
| 360 | } |
| 361 | else |
| 362 | { |
| 363 | if(!m_qDocument) |
| 364 | { |
| 365 | return false; |
| 366 | } |
| 367 | pElement = m_qDocument->FirstChildElement(rName); |
| 368 | } |
| 369 | |
| 370 | if(!pElement) |
| 371 | { |
| 372 | return false; |
| 373 | } |
| 374 | m_paNode.push_back(pElement); |
| 375 | return true; |
| 376 | } |
| 377 | |
| 378 | DefineEngineMethod( SimXMLDocument, pushFirstChildElement, bool, ( const char* name ),, |
| 379 | "@brief Push the first child Element with the given name onto the stack, making it the current Element.\n\n" |
no test coverage detected