- Nibbler now understands parsing from a list of tokens, with getOneOf.
This commit is contained in:
Paul Beckingham 2011-06-11 11:13:56 -04:00
parent a5feb6ef83
commit 8f20efc739
3 changed files with 37 additions and 1 deletions

View file

@ -587,6 +587,24 @@ bool Nibbler::getDate (const std::string& format, time_t& t)
return false;
}
////////////////////////////////////////////////////////////////////////////////
bool Nibbler::getOneOf (
const std::vector <std::string>& options,
std::string& found)
{
std::vector <std::string>::const_iterator option;
for (option = options.begin (); option != options.end (); ++option)
{
if (getLiteral (*option))
{
found = *option;
return true;
}
}
return false;
}
////////////////////////////////////////////////////////////////////////////////
bool Nibbler::skipN (const int quantity /* = 1 */)
{