Nibbler::backN

- Added a method to support multi-byte backstep through a string.
- Added unit tests.
This commit is contained in:
Paul Beckingham
2013-08-31 16:02:51 -04:00
parent 2281c5a6bf
commit 663c82837c
3 changed files with 28 additions and 4 deletions

View File

@@ -1077,6 +1077,18 @@ bool Nibbler::skipRx (const std::string& regex)
}
#endif
////////////////////////////////////////////////////////////////////////////////
bool Nibbler::backN (const int quantity /*= 1*/)
{
if (_cursor >= quantity)
{
_cursor -= quantity;
return true;
}
return false;
}
////////////////////////////////////////////////////////////////////////////////
void Nibbler::getRemainder (std::string& result)
{