limal::ValueIntCheck Class Reference

Integer range value check. More...

#include <ValueIntCheck.hpp>

Inheritance diagram for limal::ValueIntCheck:

limal::ValueCheckBase List of all members.

Public Member Functions

 ValueIntCheck (blocxx::UInt64 minValue, blocxx::UInt64 maxValue, bool inclusiveRange=true)
 ValueIntCheck (blocxx::Int64 minValue, blocxx::Int64 maxValue, bool inclusiveRange=true)
 ValueIntCheck (int minValue, int maxValue, bool inclusiveRange=true)
virtual bool isValid (const blocxx::String &value) const
virtual blocxx::String explain (const blocxx::String &value) const

Private Attributes

bool m_sign
bool m_incl
union {
   blocxx::Int64   s
   blocxx::UInt64   u
m_min
union {
   blocxx::Int64   s
   blocxx::UInt64   u
m_max

Detailed Description

Integer range value check.

The ValueIntCheck implements a simple integer range check that can be used in ValueCheck.


Constructor & Destructor Documentation

limal::ValueIntCheck::ValueIntCheck blocxx::UInt64  minValue,
blocxx::UInt64  maxValue,
bool  inclusiveRange = true
 

Constructor using a UInt64 range.

Parameters:
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::Int64  minValue,
blocxx::Int64  maxValue,
bool  inclusiveRange = true
 

Constructor using a Int64 range.

Parameters:
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...

Parameters:
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.


Member Function Documentation

virtual blocxx::String limal::ValueIntCheck::explain const blocxx::String &  value  )  const [virtual]
 

Return a string showing the integer range check.

Parameters:
value A string value.
Returns:
A string showing the check.

Implements limal::ValueCheckBase.

virtual bool limal::ValueIntCheck::isValid const blocxx::String &  value  )  const [virtual]
 

Return whether the specified value is fits into the integer range.

Parameters:
value A string value.
Returns:
true, if the value fits into the range.
Exceptions:
blocxx::StringConversionException if the value can't be converted to a integer value.

Implements limal::ValueCheckBase.


Member Data Documentation

bool limal::ValueIntCheck::m_incl [private]
 

union { ... } limal::ValueIntCheck::m_max [private]
 

union { ... } limal::ValueIntCheck::m_min [private]
 

bool limal::ValueIntCheck::m_sign [private]
 

blocxx::Int64 limal::ValueIntCheck::s [private]
 

blocxx::UInt64 limal::ValueIntCheck::u [private]
 


The documentation for this class was generated from the following file:
Generated on Tue May 2 09:52:00 2006 for limal by  doxygen 1.4.6