when this function is called we know we're working on a copy of the name, so we can "destruct" it
| 593 | |
| 594 | // when this function is called we know we're working on a copy of the name, so we can "destruct" it |
| 595 | TimingEvent* TimingEvent::GetTimerRec( LPWSTR timerId ) |
| 596 | { |
| 597 | size_t len = wcslen( timerId ); |
| 598 | size_t seperator = wcscspn( timerId, L"/|\\" ); |
| 599 | if (seperator < len) |
| 600 | { |
| 601 | timerId[seperator] = 0; |
| 602 | } |
| 603 | |
| 604 | TimingEvent* te = m_firstChild; |
| 605 | while (te) |
| 606 | { |
| 607 | if (!wcscmp( timerId, te->m_name )) |
| 608 | { |
| 609 | if (seperator < len) |
| 610 | { |
| 611 | te = te->GetTimerRec( &timerId[seperator + 1] ); |
| 612 | } |
| 613 | |
| 614 | return te; |
| 615 | } |
| 616 | te = te->m_next; |
| 617 | } |
| 618 | |
| 619 | return NULL; |
| 620 | } |
| 621 | |
| 622 | TimingEvent* TimingEvent::FindLastChildUsed() |
| 623 | { |