Enhancement - Sequence integration

- Sequence object fully integrated.
This commit is contained in:
Paul Beckingham 2009-06-06 23:55:36 -04:00
parent 7965bd5b4f
commit 9b78631e6f
6 changed files with 44 additions and 30 deletions

View file

@ -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;