UDAs - User Defined Attributes

- Added support for named allowable values.
This commit is contained in:
Paul Beckingham 2012-07-02 22:22:19 -04:00
parent 0d3f6f990d
commit 7f1d8c3682
5 changed files with 34 additions and 2 deletions

View file

@ -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.
//