mirror of
https://github.com/GothenburgBitFactory/taskwarrior.git
synced 2025-08-29 17:07:19 +02:00
Enhancement - Sequence integration
- Sequence object fully integrated.
This commit is contained in:
parent
7965bd5b4f
commit
9b78631e6f
6 changed files with 44 additions and 30 deletions
|
@ -53,6 +53,26 @@ Sequence::~Sequence ()
|
|||
{
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
bool Sequence::valid (const std::string& input) const
|
||||
{
|
||||
std::vector <std::string> ranges;
|
||||
split (ranges, input, ',');
|
||||
|
||||
std::vector <std::string>::iterator it;
|
||||
for (it = ranges.begin (); it != ranges.end (); ++it)
|
||||
{
|
||||
std::vector <std::string> range;
|
||||
split (range, *it, '-');
|
||||
|
||||
if (range.size () < 1 ||
|
||||
range.size () > 2)
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
void Sequence::parse (const std::string& input)
|
||||
{
|
||||
|
@ -121,7 +141,7 @@ void Sequence::combine (const Sequence& other)
|
|||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
bool Sequence::validId (const std::string& input)
|
||||
bool Sequence::validId (const std::string& input) const
|
||||
{
|
||||
if (input.length () == 0)
|
||||
return false;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue