PDF
AuboStudio SDK  0.6.3
arcs::aubo_scope::StringLengthValidator Struct Reference

#include <input_validator.h>

Inheritance diagram for arcs::aubo_scope::StringLengthValidator:
Collaboration diagram for arcs::aubo_scope::StringLengthValidator:

Public Member Functions

 StringLengthValidator (size_t min_length, size_t max_length)
 StringLengthValidator (std::function< std::pair< size_t, size_t >()> range_func)
bool isValid (std::string value) override
 Validates whether the input value is valid.
std::string getMessage (std::string value) override
 Returns a meaningful message in case the value is not valid.

Private Member Functions

void updateValue ()

Private Attributes

size_t min_length_ { 0 }
size_t max_length_ { ULONG_MAX }
std::function< std::pair< size_t, size_t >()> range_func_ { nullptr }

Detailed Description

Definition at line 146 of file input_validator.h.

Constructor & Destructor Documentation

◆ StringLengthValidator() [1/2]

arcs::aubo_scope::StringLengthValidator::StringLengthValidator ( size_t min_length,
size_t max_length )

◆ StringLengthValidator() [2/2]

arcs::aubo_scope::StringLengthValidator::StringLengthValidator ( std::function< std::pair< size_t, size_t >()> range_func)

Member Function Documentation

◆ getMessage()

std::string arcs::aubo_scope::StringLengthValidator::getMessage ( std::string value)
overridevirtual

Returns a meaningful message in case the value is not valid.

Parameters
valuethe invalid value. Can be included in the message if it makes sense.
Returns
message.

Implements arcs::aubo_scope::InputValidator.

◆ isValid()

bool arcs::aubo_scope::StringLengthValidator::isValid ( std::string value)
overridevirtual

Validates whether the input value is valid.

Parameters
valueto be validated.
Returns
true if value is valid.

Implements arcs::aubo_scope::InputValidator.

◆ updateValue()

void arcs::aubo_scope::StringLengthValidator::updateValue ( )
private

Member Data Documentation

◆ max_length_

size_t arcs::aubo_scope::StringLengthValidator::max_length_ { ULONG_MAX }
private

Definition at line 162 of file input_validator.h.

◆ min_length_

size_t arcs::aubo_scope::StringLengthValidator::min_length_ { 0 }
private

Definition at line 161 of file input_validator.h.

◆ range_func_

std::function<std::pair<size_t, size_t>()> arcs::aubo_scope::StringLengthValidator::range_func_ { nullptr }
private

Definition at line 163 of file input_validator.h.


The documentation for this struct was generated from the following file: