Content


NTL
Core
CDbValidatorNumber

CDbValidatorNumber


Number validator checks whether an attribute value is a number and in specified range.

You can find more information in comments below. Overrided methods can be found in corresponding base class or interface.

class CDbValidatorNumber :public CDbValidator
{
public:
    // IDbValidator methods 
    bool Validate(CDbModel *model, IDbAttribute *attribute, String &error) override;

    CDbValidatorNumber();

    CDbValidatorNumber *setIntegerOnly(const bool &value); // Set whether value should be integer 
    CDbValidatorNumber *setStrict(const bool &value); // Set whether strict comparison (check type) is required 
    CDbValidatorNumber *setMin(const DbValue &value); // Set minimum allowed value 
    CDbValidatorNumber *setMax(const DbValue &value); // Set maximum allowed value 
    CDbValidatorNumber *setTooBig(const String &value); // Set error message indicating a value is too big (greater than maximum value) 
    CDbValidatorNumber *setTooSmall(const String &value); // Set error message indicating a value is too small (less than minimum value) 

    static ReleasablePtr<CDbValidatorNumber> Create(); // Helper static method to create validator in form used in model rule adding methods 
};
Namespace: nitisa
Include: Nitisa/Db/DbValidatorNumber.h