Nibbler
- Implemented Nibbler::getN, which allows for faster extraction of compound tokens if the length is known.
This commit is contained in:
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user