* next switches the history pointer to the next item. * While searching the next item, the routine respects the search prefix set by prev(). * @return true if the pointer was switched to a later item, false otherwise. */
| 1609 | * @return true if the pointer was switched to a later item, false otherwise. |
| 1610 | */ |
| 1611 | bool ConsoleHistory::next() |
| 1612 | { |
| 1613 | bool wentNext = false; |
| 1614 | |
| 1615 | // if we didn't reach history's end ... |
| 1616 | if (_it != _history.cend()) { |
| 1617 | // we go forward until we find an item matching the prefix. |
| 1618 | for (++_it; _it != _history.cend(); ++_it) { |
| 1619 | if (!_it->isEmpty() && _it->startsWith(_prefix)) { |
| 1620 | break; |
| 1621 | } |
| 1622 | } |
| 1623 | // we did a step - no matter of a matching prefix. |
| 1624 | wentNext = true; |
| 1625 | } |
| 1626 | return wentNext; |
| 1627 | } |
| 1628 | |
| 1629 | /** |
| 1630 | * prev switches the history pointer to the previous item. |