mirror of
https://github.com/GothenburgBitFactory/taskwarrior.git
synced 2025-08-29 17:07:19 +02:00
Nibbler
- Implemented Nibbler::getN, which allows for faster extraction of compound tokens if the length is known.
This commit is contained in:
parent
10c1203c87
commit
0ecf93553c
2 changed files with 14 additions and 0 deletions
|
@ -216,6 +216,19 @@ bool Nibbler::getUntilEOS (std::string& result)
|
|||
return false;
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
bool Nibbler::getN (const int quantity, std::string& result)
|
||||
{
|
||||
if (mCursor + quantity < mLength)
|
||||
{
|
||||
result = mInput.substr (mCursor, quantity);
|
||||
mCursor += quantity;
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
bool Nibbler::getQuoted (
|
||||
char c,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue