QxOrm 1.4.9
C++ Object Relational Mapping library
Loading...
Searching...
No Matches
qx::QxValidator_WithDataType< DataType, Owner > Class Template Reference

qx::QxValidator_WithDataType<DataType, Owner> : concrete class for a custom validator with data type More...

#include <QxValidator.h>

Inheritance diagram for qx::QxValidator_WithDataType< DataType, Owner >:
qx::IxValidator qx::QxPropertyBag

Public Types

typedef std::function< void(const DataType &, QxInvalidValueX &)> type_fct_custom_validator_data_type
 
typedef std::function< void(const DataType &, const IxValidator *, QxInvalidValueX &)> type_fct_custom_validator_data_type_validator
 
- Public Types inherited from qx::IxValidator
enum  validator_type {
  not_null , not_empty , min_value , max_value ,
  min_length , max_length , date_past , date_future ,
  min_decimal , max_decimal , regular_expression , e_mail ,
  recursive_validator , custom_validator
}
 

Public Member Functions

 QxValidator_WithDataType ()
 
virtual ~QxValidator_WithDataType ()
 
void setFunction (type_fct_custom_validator_data_type fct)
 
void setFunction (type_fct_custom_validator_data_type_validator fct)
 
virtual void validate (void *pOwner, QxInvalidValueX &lstInvalidValues) const
 
- Public Member Functions inherited from qx::IxValidator
 IxValidator (validator_type type)
 
virtual ~IxValidator ()
 
validator_type getType () const
 
QString getMessage () const
 
QString getGroup () const
 
QVariant getConstraint () const
 
QVariantList getConstraints () const
 
IxDataMembergetDataMember () const
 
void setMessage (const QString &s)
 
void setGroup (const QString &s)
 
void setConstraint (const QVariant &v)
 
void setConstraints (const QVariantList &lst)
 
void setDataMember (IxDataMember *p)
 
- Public Member Functions inherited from qx::QxPropertyBag
 QxPropertyBag ()
 
virtual ~QxPropertyBag ()
 
void setPropertyBag (const QString &key, const QVariant &value)
 
QVariant getPropertyBag (const QString &key) const
 
void removePropertyBag (const QString &key)
 
void clearPropertyBag ()
 
long countPropertyBag () const
 
QList< QString > getAllPropertyBagKeys () const
 

Protected Attributes

type_fct_custom_validator_data_type m_fctCustomValidator_DataType
 Custom validator function : global function with value.
 
type_fct_custom_validator_data_type_validator m_fctCustomValidator_DataTypeValidator
 Custom validator function : global function with value and a IxValidator pointer containing all parameters.
 
- Protected Attributes inherited from qx::IxValidator
validator_type m_type
 Validator type.
 
QString m_message
 Validator message when invalid value is detected.
 
QString m_group
 Validator group.
 
QVariantList m_Constraints
 List of constraints to verify.
 
IxDataMemberm_pDataMember
 Registered property associated to validator.
 
- Protected Attributes inherited from qx::QxPropertyBag
type_hash_prop_bag_ptr m_lstPropertyBag
 List of all properties in the bag (meta-data)
 

Additional Inherited Members

- Protected Types inherited from qx::QxPropertyBag
typedef QHash< QString, QVariant > type_hash_prop_bag
 
typedef std::shared_ptr< type_hash_prop_bagtype_hash_prop_bag_ptr
 
- Protected Member Functions inherited from qx::IxValidator
void initDefaultMessage ()
 
void validateNotNull (const QVariant &v, QxInvalidValueX &lstInvalidValues) const
 
void validateNotEmpty (const QVariant &v, QxInvalidValueX &lstInvalidValues) const
 
void validateMinValue (const QVariant &v, QxInvalidValueX &lstInvalidValues) const
 
void validateMaxValue (const QVariant &v, QxInvalidValueX &lstInvalidValues) const
 
void validateMinDecimal (const QVariant &v, QxInvalidValueX &lstInvalidValues) const
 
void validateMaxDecimal (const QVariant &v, QxInvalidValueX &lstInvalidValues) const
 
void validateMinLength (const QVariant &v, QxInvalidValueX &lstInvalidValues) const
 
void validateMaxLength (const QVariant &v, QxInvalidValueX &lstInvalidValues) const
 
void validateDatePast (const QVariant &v, QxInvalidValueX &lstInvalidValues) const
 
void validateDateFuture (const QVariant &v, QxInvalidValueX &lstInvalidValues) const
 
void validateRegularExpression (const QVariant &v, QxInvalidValueX &lstInvalidValues) const
 
void validateEMail (const QVariant &v, QxInvalidValueX &lstInvalidValues) const
 

Detailed Description

template<typename DataType, class Owner>
class qx::QxValidator_WithDataType< DataType, Owner >

qx::QxValidator_WithDataType<DataType, Owner> : concrete class for a custom validator with data type

For more informations about QxValidator module, goto the FAQ of QxOrm website : https://www.qxorm.com/qxorm_en/faq.html#faq_250

Definition at line 108 of file QxValidator.h.

Member Typedef Documentation

◆ type_fct_custom_validator_data_type

template<typename DataType , class Owner >
typedef std::function<void (const DataType &, QxInvalidValueX &)> qx::QxValidator_WithDataType< DataType, Owner >::type_fct_custom_validator_data_type

Definition at line 113 of file QxValidator.h.

◆ type_fct_custom_validator_data_type_validator

template<typename DataType , class Owner >
typedef std::function<void (const DataType &, const IxValidator *, QxInvalidValueX &)> qx::QxValidator_WithDataType< DataType, Owner >::type_fct_custom_validator_data_type_validator

Definition at line 114 of file QxValidator.h.

Constructor & Destructor Documentation

◆ QxValidator_WithDataType()

template<typename DataType , class Owner >
qx::QxValidator_WithDataType< DataType, Owner >::QxValidator_WithDataType ( )
inline

Definition at line 123 of file QxValidator.h.

◆ ~QxValidator_WithDataType()

template<typename DataType , class Owner >
virtual qx::QxValidator_WithDataType< DataType, Owner >::~QxValidator_WithDataType ( )
inlinevirtual

Definition at line 124 of file QxValidator.h.

Member Function Documentation

◆ setFunction() [1/2]

template<typename DataType , class Owner >
void qx::QxValidator_WithDataType< DataType, Owner >::setFunction ( type_fct_custom_validator_data_type fct)
inline

Definition at line 126 of file QxValidator.h.

◆ setFunction() [2/2]

template<typename DataType , class Owner >
void qx::QxValidator_WithDataType< DataType, Owner >::setFunction ( type_fct_custom_validator_data_type_validator fct)
inline

Definition at line 127 of file QxValidator.h.

◆ validate()

template<typename DataType , class Owner >
virtual void qx::QxValidator_WithDataType< DataType, Owner >::validate ( void * pOwner,
QxInvalidValueX & lstInvalidValues ) const
inlinevirtual

Reimplemented from qx::IxValidator.

Definition at line 129 of file QxValidator.h.

Member Data Documentation

◆ m_fctCustomValidator_DataType

template<typename DataType , class Owner >
type_fct_custom_validator_data_type qx::QxValidator_WithDataType< DataType, Owner >::m_fctCustomValidator_DataType
protected

Custom validator function : global function with value.

Definition at line 118 of file QxValidator.h.

◆ m_fctCustomValidator_DataTypeValidator

template<typename DataType , class Owner >
type_fct_custom_validator_data_type_validator qx::QxValidator_WithDataType< DataType, Owner >::m_fctCustomValidator_DataTypeValidator
protected

Custom validator function : global function with value and a IxValidator pointer containing all parameters.

Definition at line 119 of file QxValidator.h.


The documentation for this class was generated from the following file: