44 |
|
#include <sstream> |
45 |
|
#include "utils/CaseConversion.hpp" |
46 |
|
#include "utils/StringTokenizer.hpp" |
47 |
< |
|
47 |
> |
namespace oopse { |
48 |
|
/** |
49 |
|
* This class allows to recognize constraint predicates, so that they can be combined using |
50 |
|
* composition operators. Every constraint predicate must be derived from this class |
331 |
|
} |
332 |
|
|
333 |
|
|
334 |
< |
NotEmptyConstraint isNotEmpty() { |
335 |
< |
return NotEmptyConstraint(); |
336 |
< |
} |
337 |
< |
|
338 |
< |
ZeroConstraint isZero() { |
339 |
< |
return ZeroConstraint(); |
340 |
< |
} |
334 |
> |
NotEmptyConstraint isNotEmpty(); |
335 |
> |
ZeroConstraint isZero(); |
336 |
|
|
337 |
< |
ParamConstraintFacade<NonZeroConstraint> isNonZero() { |
338 |
< |
return ParamConstraintFacade<NonZeroConstraint>(); |
339 |
< |
} |
337 |
> |
ParamConstraintFacade<NonZeroConstraint> isNonZero(); |
338 |
> |
PositiveConstraint isPositive(); |
339 |
> |
NonPositiveConstraint isNonPositive(); |
340 |
|
|
341 |
< |
PositiveConstraint isPositive() { |
347 |
< |
return PositiveConstraint(); |
348 |
< |
} |
349 |
< |
|
350 |
< |
NonPositiveConstraint isNonPositive() { |
351 |
< |
return NonPositiveConstraint(); |
352 |
< |
} |
341 |
> |
NegativeConstraint isNegative(); |
342 |
|
|
343 |
< |
NegativeConstraint isNegative() { |
355 |
< |
return NegativeConstraint(); |
356 |
< |
} |
343 |
> |
NonNegativeConstraint isNonNegative(); |
344 |
|
|
358 |
– |
NonNegativeConstraint isNonNegative() { |
359 |
– |
return NonNegativeConstraint(); |
360 |
– |
} |
361 |
– |
|
345 |
|
template<typename T> |
346 |
< |
LessThanConstraint<T>isLessThan(T& v ) { |
346 |
> |
inline LessThanConstraint<T>isLessThan(T& v ) { |
347 |
|
return LessThanConstraint<T>(v); |
348 |
|
} |
349 |
|
|
350 |
|
template<typename T> |
351 |
< |
LessThanOrEqualToConstraint<T> isLessThanOrEqualTo(T& v ) { |
351 |
> |
inline LessThanOrEqualToConstraint<T> isLessThanOrEqualTo(T& v ) { |
352 |
|
return ParamConstraintFacade<LessThanOrEqualToConstraint<T> >(v); |
353 |
|
} |
354 |
|
|
355 |
|
template<typename T> |
356 |
< |
EqualConstraint<T> isEqual(T& v ) { |
356 |
> |
inline EqualConstraint<T> isEqual(T& v ) { |
357 |
|
return EqualConstraint<T>(v); |
358 |
|
} |
359 |
|
|
360 |
|
template<typename T> |
361 |
< |
GreaterThanConstraint<T> isGreaterThan(T& v ) { |
361 |
> |
inline GreaterThanConstraint<T> isGreaterThan(T& v ) { |
362 |
|
return GreaterThanConstraint<T>(v); |
363 |
|
} |
364 |
|
|
365 |
|
template<typename T> |
366 |
< |
GreaterThanOrEqualTo<T> isGreaterThanOrEqualTo(T& v ) { |
366 |
> |
inline GreaterThanOrEqualTo<T> isGreaterThanOrEqualTo(T& v ) { |
367 |
|
return GreaterThanOrEqualTo<T>(v); |
368 |
|
} |
369 |
|
|
370 |
< |
EqualIgnoreCaseConstraint isEqualIgnoreCase(std::string str) { |
388 |
< |
return EqualIgnoreCaseConstraint(str); |
370 |
> |
EqualIgnoreCaseConstraint isEqualIgnoreCase(std::string str); |
371 |
|
} |
390 |
– |
|
372 |
|
#endif |