Enhancements - delete, start

- Implemented delete command.
- Implemented start command.
This commit is contained in:
Paul Beckingham 2009-06-15 23:47:42 -04:00
parent 6e6f86783f
commit 1551362d1e
3 changed files with 83 additions and 52 deletions

View file

@ -32,8 +32,11 @@
#include "util.h"
#include "Date.h"
#include "Duration.h"
#include "Context.h"
#include "Att.h"
extern Context context;
static const char* internalNames[] =
{
"entry",
@ -42,6 +45,8 @@ static const char* internalNames[] =
"mask",
"imask",
// "limit",
"status",
"description",
};
static const char* modifiableNames[] =
@ -347,18 +352,21 @@ bool Att::validNameValue (
throw std::string ("The '") + name + "' attribute must be an integer.";
}
// Some attributes are intended to be private.
else if (name == "entry" ||
name == "start" ||
name == "end" ||
name == "mask" ||
name == "imask" ||
name == "uuid" ||
name == "status")
// Some attributes are intended to be private, unless the command is read-
// only, in which cased these are perfectly valid elements of a filter.
else if (name == "entry" ||
name == "start" ||
name == "end" ||
name == "mask" ||
name == "imask" ||
name == "uuid" ||
name == "status" ||
name == "description")
{
throw std::string ("\"") +
name +
"\" is not an attribute you may modify directly.";
if (context.cmd.isWriteCommand ())
throw std::string ("\"") +
name +
"\" is not an attribute you may modify directly.";
}
else