minLength
mach::FieldValidationBuilder::minLength
Adds minimum length validation.
Description
Section titled “Description”Applies a minimum length validation rule to a string field.
Syntax
Section titled “Syntax”FieldValidationBuilder& minLength(std::size_t minLength);Return Value
Section titled “Return Value”A reference to the current FieldValidationBuilder instance.
Parameters
Section titled “Parameters”| Parameter | Description |
|---|---|
minLength |
The minimum allowed length. |
Remarks
Section titled “Remarks”Applying the same validation rule multiple times is allowed.
Thread Safety
Section titled “Thread Safety”This method is not thread-safe and should only be called during validation configuration.
Example
Section titled “Example”void validate(mach::ValidationBuilder<User>& validation) const { validation.field(&User::name) .minLength(3);}See Also
Section titled “See Also”| Name | Description |
|---|---|
length |
Adds length validation. |
maxLength |
Adds maximum length validation. |