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