AuboCaps  0.6.0
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
 
std::string getMessage (std::string value) override
 Returns a meaningful message in case the value is not valid. More...
 

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 252 of file input_validator.h.

Constructor & Destructor Documentation

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

Definition at line 254 of file input_validator.h.

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

Definition at line 259 of file input_validator.h.

Member Function Documentation

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

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.

Definition at line 272 of file input_validator.h.

bool arcs::aubo_scope::StringLengthValidator::isValid ( std::string  value)
inlineoverridevirtual
Parameters
valueto be validated.
Returns
true if value is valid.

Implements arcs::aubo_scope::InputValidator.

Definition at line 264 of file input_validator.h.

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

Definition at line 288 of file input_validator.h.

Member Data Documentation

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

Definition at line 303 of file input_validator.h.

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

Definition at line 302 of file input_validator.h.

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

Definition at line 304 of file input_validator.h.


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