MCPcopy Create free account
hub / github.com/CobaltFusion/DebugViewPP / FindLine

Method FindLine

DebugView++/LogView.cpp:1551–1576  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1549
1550template <typename Predicate>
1551int CLogView::FindLine(Predicate pred, int direction) const
1552{
1553 SetCursor(::LoadCursor(nullptr, IDC_ARROW));
1554 Win32::ScopedCursor cursor(::LoadCursor(nullptr, IDC_WAIT));
1555
1556 int begin = std::max(GetNextItem(-1, LVNI_FOCUSED), 0);
1557 int line = begin;
1558
1559 if (m_logLines.empty())
1560 return -1;
1561
1562 do
1563 {
1564 line += direction;
1565 if (line < 0)
1566 line += m_logLines.size();
1567 if (line >= static_cast<int>(m_logLines.size()))
1568 line -= m_logLines.size();
1569
1570 if (pred(m_logLines[line]))
1571 return line;
1572 }
1573 while (line != begin);
1574
1575 return -1;
1576}
1577
1578bool CLogView::Find(const std::string& text, int direction)
1579{

Callers

nothing calls this directly

Calls 1

sizeMethod · 0.45

Tested by

no test coverage detected