#include <ValueIntCheck.hpp>

Public Member Functions | |
| ValueIntCheck (BLOCXX_NAMESPACE::UInt64 minValue, BLOCXX_NAMESPACE::UInt64 maxValue, bool inclusiveRange=true) | |
| ValueIntCheck (BLOCXX_NAMESPACE::Int64 minValue, BLOCXX_NAMESPACE::Int64 maxValue, bool inclusiveRange=true) | |
| ValueIntCheck (int minValue, int maxValue, bool inclusiveRange=true) | |
| virtual bool | isValid (const BLOCXX_NAMESPACE::String &value) const |
| virtual BLOCXX_NAMESPACE::String | explain (const BLOCXX_NAMESPACE::String &value) const |
Private Attributes | |
| bool | m_sign |
| bool | m_incl |
| union { | |
| BLOCXX_NAMESPACE::Int64 s | |
| BLOCXX_NAMESPACE::UInt64 u | |
| } | m_min |
| union { | |
| BLOCXX_NAMESPACE::Int64 s | |
| BLOCXX_NAMESPACE::UInt64 u | |
| } | m_max |
The ValueIntCheck implements a simple integer range check that can be used in ValueCheck.
| limal::ValueIntCheck::ValueIntCheck | ( | BLOCXX_NAMESPACE::UInt64 | minValue, | |
| BLOCXX_NAMESPACE::UInt64 | maxValue, | |||
| bool | inclusiveRange = true | |||
| ) |
Constructor using a UInt64 range.
| minValue | Minimal value for the range. | |
| maxValue | Maximal value for the range. | |
| inclusiveRange | Whether to check if the value is less (inclusiveRange=false) if less or equal the maxValue. |
| limal::ValueIntCheck::ValueIntCheck | ( | BLOCXX_NAMESPACE::Int64 | minValue, | |
| BLOCXX_NAMESPACE::Int64 | maxValue, | |||
| bool | inclusiveRange = true | |||
| ) |
Constructor using a Int64 range.
| minValue | Minimal value for the range. | |
| maxValue | Maximal value for the range. | |
| inclusiveRange | Whether to check if the value is less (inclusiveRange=false) if less or equal the maxValue. |
| limal::ValueIntCheck::ValueIntCheck | ( | int | minValue, | |
| int | maxValue, | |||
| bool | inclusiveRange = true | |||
| ) |
Constructor using int range.
Note: This constructor will be used by default, if you simply call:
ValueIntCheck(0, 42)
To avoid conversion problems on 64 bit integers, you should choose the right constructors:
ValueIntCheck( Int64(0), Int64(42)) ValueIntCheck(UInt64(0), UInt64(42))
instead...
| minValue | Minimal value for the range. | |
| maxValue | Maximal value for the range. | |
| inclusiveRange | Whether to check if the value is less (inclusiveRange=false) if less or equal the maxValue. |
| virtual bool limal::ValueIntCheck::isValid | ( | const BLOCXX_NAMESPACE::String & | value | ) | const [virtual] |
Return whether the specified value is fits into the integer range.
| value | A string value. |
| blocxx::StringConversionException | if the value can't be converted to a integer value. |
Implements limal::ValueCheckBase.
| virtual BLOCXX_NAMESPACE ::String limal::ValueIntCheck::explain | ( | const BLOCXX_NAMESPACE::String & | value | ) | const [virtual] |
Return a string showing the integer range check.
| value | A string value. |
Implements limal::ValueCheckBase.
bool limal::ValueIntCheck::m_sign [private] |
bool limal::ValueIntCheck::m_incl [private] |
| BLOCXX_NAMESPACE ::Int64 limal::ValueIntCheck::s |
| BLOCXX_NAMESPACE ::UInt64 limal::ValueIntCheck::u |
union { ... } limal::ValueIntCheck::m_min [private] |
| BLOCXX_NAMESPACE ::Int64 limal::ValueIntCheck::s |
| BLOCXX_NAMESPACE ::UInt64 limal::ValueIntCheck::u |
union { ... } limal::ValueIntCheck::m_max [private] |
1.5.5