| 500 | //----------------------------------------------------------------------------- |
| 501 | |
| 502 | SimObject* SimSet::findObjectByLineNumber(const char* fileName, S32 declarationLine, bool searchChildren) |
| 503 | { |
| 504 | if (!fileName) |
| 505 | return NULL; |
| 506 | |
| 507 | if (declarationLine < 0) |
| 508 | return NULL; |
| 509 | |
| 510 | StringTableEntry fileEntry = StringTable->insert(fileName); |
| 511 | |
| 512 | for (iterator i = begin(); i != end(); i++) |
| 513 | { |
| 514 | SimObject *childObj = static_cast<SimObject*>(*i); |
| 515 | |
| 516 | if(childObj->getFilename() == fileEntry && childObj->getDeclarationLine() == declarationLine) |
| 517 | return childObj; |
| 518 | else if (searchChildren) |
| 519 | { |
| 520 | SimSet* childSet = dynamic_cast<SimSet*>(*i); |
| 521 | |
| 522 | if (childSet) |
| 523 | { |
| 524 | SimObject* found = childSet->findObjectByLineNumber(fileName, declarationLine, searchChildren); |
| 525 | if (found) |
| 526 | return found; |
| 527 | } |
| 528 | } |
| 529 | } |
| 530 | |
| 531 | return NULL; |
| 532 | } |
| 533 | |
| 534 | //----------------------------------------------------------------------------- |
| 535 |
no test coverage detected