Enhancements - validation

- Implemented Cmd::isReadOnlyCommand.
- Implemented Cmd::isWriteCommand.
- Added unit tests for above.
This commit is contained in:
Paul Beckingham 2009-06-12 01:45:42 -04:00
parent bc8aba26a9
commit 0b14efbb76
7 changed files with 217 additions and 322 deletions

View file

@ -361,7 +361,8 @@ std::cout << "# parse sequence '" << *arg << "'" << std::endl;
// Tags to include begin with '+'.
else if (arg->length () > 1 &&
(*arg)[0] == '+')
(*arg)[0] == '+' &&
validTag (*arg))
{
std::cout << "# parse tag addition '" << *arg << "'" << std::endl;
if (foundSequence)
@ -372,7 +373,8 @@ std::cout << "# parse tag addition '" << *arg << "'" << std::endl;
// Tags to remove begin with '-'.
else if (arg->length () > 1 &&
(*arg)[0] == '-')
(*arg)[0] == '-' &&
validTag (*arg))
{
std::cout << "# parse tag removal '" << *arg << "'" << std::endl;
if (foundSequence)
@ -445,6 +447,10 @@ std::cout << "# parse post-termination description '" << *arg << "'"
if (validDescription (descCandidate))
task.set ("description", descCandidate);
// TODO task.validate ()
// TODO if readOnlyCommand (cmd.command) then any attributes are allowed
// TODO if writeCommand (cmd.command) then only modifiable attributes are allowed
constructFilter ();
// If no command was specified, and there were no command line arguments