libcamgm
|
Base class to check a value. More...
#include <ValueCheck.hpp>
Public Member Functions | |
virtual | ~ValueCheckBase () |
virtual bool | isValid (const std::string &value) const =0 |
virtual std::string | explain (const std::string &value) const =0 |
![]() | |
ReferenceCounted () | |
ReferenceCounted (const ReferenceCounted &rhs) | |
virtual | ~ReferenceCounted () |
ReferenceCounted & | operator= (const ReferenceCounted &) |
unsigned | refCount () const |
void | ref () const |
void | unref () const |
Protected Member Functions | |
ValueCheckBase () | |
![]() | |
virtual std::ostream & | dumpOn (std::ostream &str) const |
virtual void | ref_to (unsigned) const |
virtual void | unref_to (unsigned) const |
Private Member Functions | |
ValueCheckBase (const ValueCheckBase &r) | |
ValueCheckBase & | operator= (const ValueCheckBase &r) |
Friends | |
class | ValueCheck |
Additional Inherited Members | |
![]() | |
static void | add_ref (const ReferenceCounted *ptr_r) |
static void | release (const ReferenceCounted *ptr_r) |
![]() | |
void | intrusive_ptr_add_ref (const ReferenceCounted *ptr_r) |
void | intrusive_ptr_release (const ReferenceCounted *ptr_r) |
std::ostream & | operator<< (std::ostream &str, const ReferenceCounted &obj) |
Base class to check a value.
The ValueCheckBase class, is a abstract base class, allowing to implement a single check on a string value.
A check derived from this class can be combined in ValueCheck class to expressions.
|
inlinevirtual |
Destructor.
|
inlineprotected |
Default constructor.
|
inlineprivate |
Copy constructor, private. Use the default constructor to implement a copy constructor in your derived class.
|
pure virtual |
Returns a string explaining / showing the check.
For example, if your check implements the evaluation whether the value (e.g. "2"
) is lower than 5
, implement it as:
The resulting string will be "MyCheck('2' < 5)"
if the value parameter string was "2"
.
value | The value to evaluate. |
Implemented in ca_mgm::ValueCheck, ca_mgm::ValueIntCheck, ca_mgm::ValuePerlRECheck, and ca_mgm::ValuePosixRECheck.
|
pure virtual |
Evaluates a check for the specified string value parameter to a boolean or throws an exception on failure.
For example, if you want a check that evaluates whether the value (e.g. "2"
) is lower than 5
, implement it as:
value | The value to evaluate. |
Implemented in ca_mgm::ValueCheck, ca_mgm::ValueIntCheck, ca_mgm::ValuePerlRECheck, and ca_mgm::ValuePosixRECheck.
|
private |
Copy operator, private.
|
friend |
Permit the ValueCheck class the access to the reference counter.