Enhancement - Task::operator==

- Implemented Task::operator==.
- Implemented unit tests.
This commit is contained in:
Paul Beckingham 2009-06-25 17:08:39 -04:00
parent a56eeb9ec2
commit 1cfe879409
3 changed files with 24 additions and 1 deletions

View file

@ -59,6 +59,21 @@ Task& Task::operator= (const Task& other)
return *this;
}
////////////////////////////////////////////////////////////////////////////////
// The uuid and id attributes must be exempt for comparison.
bool Task::operator== (const Task& other)
{
if (size () != other.size ())
return false;
foreach (att, *this)
if (att->first != "uuid")
if (att->second.value () != other.get (att->first))
return false;
return true;
}
////////////////////////////////////////////////////////////////////////////////
// Attempt an FF4 parse first, using Record::parse, and in the event of an error
// try a legacy parse (F3, FF2). Note that FF1 is no longer supported.