mirror of
https://github.com/GothenburgBitFactory/taskwarrior.git
synced 2025-08-30 02:17:21 +02:00
Parsing
- Nibbler now understands parsing from a list of tokens, with getOneOf.
This commit is contained in:
parent
a5feb6ef83
commit
8f20efc739
3 changed files with 37 additions and 1 deletions
|
@ -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 */)
|
||||
{
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue