String validator checks whether an attribute value is a string and its length is in specified range.
You can find more information in comments below. Overrided methods can be found in corresponding base class or interface.
class CDbValidatorString :public CDbValidator
{
public:
// IDbValidator methods
bool Validate(CDbModel *model, IDbAttribute *attribute, String &error) override;
CDbValidatorString();
CDbValidatorString *setStrict(const bool &value); // Set whether strict comparison (check type) is required
CDbValidatorString *setMin(const size_t &value); // Set minimum required string length
CDbValidatorString *setMax(const size_t &value); // Set maximum allowed string length
CDbValidatorString *setLength(const size_t &value); // Set fixed string length is only allowed
CDbValidatorString *setTooShort(const String &value); // Set error message indication string is too short
CDbValidatorString *setTooLong(const String &value); // Set error message indication string is too long
static ReleasablePtr<CDbValidatorString> Create(); // Helper static method to create validator in form used in model rule adding methods
};
Namespace: | nitisa |
Include: | Nitisa/Db/DbValidatorString.h |