mirror of
https://github.com/GothenburgBitFactory/taskwarrior.git
synced 2025-09-06 17:37:21 +02:00
UDAs - User Defined Attributes
- Added support for named allowable values.
This commit is contained in:
parent
0d3f6f990d
commit
7f1d8c3682
5 changed files with 34 additions and 2 deletions
|
@ -57,6 +57,23 @@ ColumnUDA::~ColumnUDA ()
|
|||
{
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
bool ColumnUDA::validate (std::string& value)
|
||||
{
|
||||
// No restrictions.
|
||||
if (_values.size () == 0)
|
||||
return true;
|
||||
|
||||
// Look for exact match value.
|
||||
std::vector <std::string>::iterator i;
|
||||
for (i = _values.begin (); i != _values.end (); ++i)
|
||||
if (*i == value)
|
||||
return true;
|
||||
|
||||
// Fail if not found.
|
||||
return false;
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
// Set the minimum and maximum widths for the value.
|
||||
//
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue