Task Refactoring

- Task is no longer a map of string to Att.  Att is itself a name/
  value pair, so the name was redundant.  Task is now a map of string
  to string.  This brings the obsoletion of Att much closer.
This commit is contained in:
Paul Beckingham
2011-08-07 22:41:25 -04:00
parent 85e77c1958
commit e2a8f85a2f
13 changed files with 120 additions and 128 deletions

View File

@@ -86,19 +86,18 @@ int CmdDenotate::execute (std::string& output)
{
Task before (*task);
std::vector <Att> annotations;
std::map <std::string, std::string> annotations;
task->getAnnotations (annotations);
if (annotations.size () == 0)
throw std::string (STRING_CMD_DENO_NONE);
std::vector <Att>::iterator i;
std::map <std::string, std::string>::iterator i;
std::string anno;
bool match = false;
for (i = annotations.begin (); i != annotations.end (); ++i)
{
anno = i->value ();
if (anno == pattern)
if (i->second == pattern)
{
match = true;
annotations.erase (i);
@@ -110,9 +109,7 @@ int CmdDenotate::execute (std::string& output)
{
for (i = annotations.begin (); i != annotations.end (); ++i)
{
anno = i->value ();
std::string::size_type loc = find (anno, pattern, sensitive);
std::string::size_type loc = find (i->second, pattern, sensitive);
if (loc != std::string::npos)
{
annotations.erase (i);