| 537 | } |
| 538 | |
| 539 | TimingEvent* TimingEvent::GetTimer( LPCWSTR timerId ) |
| 540 | { |
| 541 | size_t len = wcslen( timerId ); |
| 542 | size_t seperator = wcscspn( timerId, L"/|\\" ); |
| 543 | |
| 544 | if (seperator < len) |
| 545 | { |
| 546 | LPWSTR idCopy = new WCHAR[len + 1]; |
| 547 | wcscpy_s( idCopy, len + 1, timerId ); |
| 548 | idCopy[seperator] = 0; |
| 549 | |
| 550 | TimingEvent* te = m_firstChild; |
| 551 | while (te) |
| 552 | { |
| 553 | if (!wcscmp( idCopy, te->m_name )) |
| 554 | { |
| 555 | te = te->GetTimerRec( &idCopy[seperator + 1] ); |
| 556 | delete [] idCopy; |
| 557 | return te; |
| 558 | } |
| 559 | te = te->m_next; |
| 560 | } |
| 561 | |
| 562 | delete [] idCopy; |
| 563 | } |
| 564 | else |
| 565 | { |
| 566 | TimingEvent* te = m_firstChild; |
| 567 | while (te) |
| 568 | { |
| 569 | if (!wcscmp( timerId, te->m_name )) |
| 570 | { |
| 571 | return te; |
| 572 | } |
| 573 | te = te->m_next; |
| 574 | } |
| 575 | } |
| 576 | return NULL; |
| 577 | } |
| 578 | |
| 579 | TimingEvent* TimingEvent::GetParent() |
| 580 | { |
no test coverage detected