1 #ifndef AUBO_SCOPE_KEYBOARD_INPUT_VALIDATOR_H 2 #define AUBO_SCOPE_KEYBOARD_INPUT_VALIDATOR_H 13 namespace aubo_scope {
36 virtual bool isValid(std::string value) = 0;
45 virtual std::string
getMessage(std::string value) = 0;
54 bool isValid(std::string value)
override;
56 std::string
getMessage(std::string value)
override;
62 int min_value_{ INT_MIN };
63 int max_value_{ INT_MAX };
65 std::function<std::pair<int, int>()> range_func_{
nullptr };
73 std::function<std::pair<uint32_t, uint32_t>()> range_func);
75 bool isValid(std::string value)
override;
77 std::string
getMessage(std::string value)
override;
83 uint32_t min_value_{ 0 };
84 uint32_t max_value_{ UINT_MAX };
86 std::function<std::pair<uint32_t, uint32_t>()> range_func_{
nullptr };
92 bool is_min_inclusive =
true,
93 bool is_max_inclusive =
true);
98 std::function<std::tuple<double, double, bool, bool>()> range_func);
100 bool isValid(std::string value)
override;
102 std::string
getMessage(std::string value)
override;
108 double min_value_{ DBL_MIN };
109 double max_value_{ DBL_MAX };
110 std::function<std::pair<double, double>()> range_func_{
nullptr };
111 std::function<std::tuple<double, double, bool, bool>()>
112 range_func_with_flags_{
nullptr };
113 bool is_min_inclusive_{
true };
114 bool is_max_inclusive_{
true };
122 std::function<std::pair<size_t, size_t>()> range_func);
124 bool isValid(std::string value)
override;
126 std::string
getMessage(std::string value)
override;
132 size_t min_length_{ 0 };
133 size_t max_length_{ ULONG_MAX };
134 std::function<std::pair<size_t, size_t>()> range_func_{
nullptr };