limal
ValueIntCheck.hpp
Go to the documentation of this file.
1 /*---------------------------------------------------------------------\
2 | |
3 | _ _ _ _ __ _ |
4 | | | | | | \_/ | / \ | | |
5 | | | | | | |_| | / /\ \ | | |
6 | | |__ | | | | | | / ____ \ | |__ |
7 | |____||_| |_| |_|/ / \ \|____| |
8 | |
9 | core library |
10 | |
11 | (C) SUSE Linux Products GmbH |
12 \----------------------------------------------------------------------/
13 
14  File: ValueIntCheck.hpp
15 
16  Author: Marius Tomaschewski
17  Maintainer: Marius Tomaschewski
18 
19  Purpose:
20 
21 /-*/
33 #ifndef LIMAL_VALUE_INT_CHECK_HPP
34 #define LIMAL_VALUE_INT_CHECK_HPP
35 
36 #include <limal/config.h>
37 #include <limal/ValueCheck.hpp>
38 
39 #include <blocxx/Types.hpp>
40 #include <blocxx/String.hpp>
41 
42 namespace LIMAL_NAMESPACE
43 {
44 
45 // -------------------------------------------------------------------
53 {
54 public:
63  ValueIntCheck(blocxx::UInt64 minValue,
64  blocxx::UInt64 maxValue,
65  bool inclusiveRange = true);
66 
75  ValueIntCheck(blocxx::Int64 minValue,
76  blocxx::Int64 maxValue,
77  bool inclusiveRange = true);
78 
100  ValueIntCheck(int minValue,
101  int maxValue,
102  bool inclusiveRange = true);
103 
113  virtual bool
114  isValid(const blocxx::String &value) const;
115 
122  virtual blocxx::String
123  explain(const blocxx::String &value) const;
124 
125 private:
126  bool m_sign;
127  bool m_incl;
128  union {
129  blocxx::Int64 s;
130  blocxx::UInt64 u;
131  } m_min;
132  union {
133  blocxx::Int64 s;
134  blocxx::UInt64 u;
135  } m_max;
136 };
137 
138 
139 } // End of LIMAL_NAMESPACE
140 
141 #endif // LIMAL_VALUE_INT_CHECK_HPP
142 // vim: set ts=8 sts=8 sw=8 ai noet: