Integration - tag parsing

- Added +tag, -tag support to Context.
- Unit tests still broken.
- Task is still broken.
This commit is contained in:
Paul Beckingham 2009-06-07 17:27:08 -04:00
parent bf4cf8e786
commit 72e3f76ed9
2 changed files with 21 additions and 8 deletions

View file

@ -215,6 +215,7 @@ void Context::dispatch ()
return out; return out;
*/ */
throw std::string ("unimplemented Context::dispatch");
} }
//////////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////////////
@ -328,6 +329,8 @@ void Context::loadCorrectConfigFile ()
void Context::parse () void Context::parse ()
{ {
Att attribute; Att attribute;
tagAdditions.clear ();
tagRemovals.clear ();
std::string descCandidate = ""; std::string descCandidate = "";
bool terminated = false; bool terminated = false;
bool foundSequence = false; bool foundSequence = false;
@ -355,19 +358,27 @@ std::cout << "# parse sequence '" << *arg << "'" << std::endl;
foundSequence = true; foundSequence = true;
} }
/* // Tags to include begin with '+'.
// Tags begin with + or - and contain arbitrary text. else if (arg->length () > 1 &&
else if (validTag (arg)) (*arg)[0] == '+')
{ {
std::cout << "# parse tag addition '" << *arg << "'" << std::endl;
if (foundSequence) if (foundSequence)
foundSomethingAfterSequence = true; foundSomethingAfterSequence = true;
if (arg[0] == '+') tagAdditions.push_back (arg->substr (1, std::string::npos));
task.addTag (arg->substr (1, std::string::npos)); }
else if (arg[0] == '-')
task.addRemoveTag (arg->substr (1, std::string::npos)); // Tags to remove begin with '-'.
else if (arg->length () > 1 &&
(*arg)[0] == '-')
{
std::cout << "# parse tag removal '" << *arg << "'" << std::endl;
if (foundSequence)
foundSomethingAfterSequence = true;
tagRemovals.push_back (arg->substr (1, std::string::npos));
} }
*/
else if (attribute.valid (*arg)) else if (attribute.valid (*arg))
{ {

View file

@ -68,6 +68,8 @@ public:
std::string program; std::string program;
std::vector <std::string> args; std::vector <std::string> args;
Cmd cmd; Cmd cmd;
std::vector <std::string> tagAdditions;
std::vector <std::string> tagRemovals;
private: private:
std::vector <std::string> messages; std::vector <std::string> messages;