Пример #1
0
void IxValidator::validate(void * pOwner, QxInvalidValueX & lstInvalidValues) const
{
   if (! pOwner) { qAssert(false); return; }
   if (! m_pDataMember) { return; }
   QVariant val = m_pDataMember->toVariant(pOwner);

   switch (m_type)
   {
      case not_null:             validateNotNull(val, lstInvalidValues);               break;
      case not_empty:            validateNotEmpty(val, lstInvalidValues);              break;
      case min_value:            validateMinValue(val, lstInvalidValues);              break;
      case max_value:            validateMaxValue(val, lstInvalidValues);              break;
      case min_length:           validateMinLength(val, lstInvalidValues);             break;
      case max_length:           validateMaxLength(val, lstInvalidValues);             break;
      case date_past:            validateDatePast(val, lstInvalidValues);              break;
      case date_future:          validateDateFuture(val, lstInvalidValues);            break;
      case min_decimal:          validateMinDecimal(val, lstInvalidValues);            break;
      case max_decimal:          validateMaxDecimal(val, lstInvalidValues);            break;
      case regular_expression:   validateRegularExpression(val, lstInvalidValues);     break;
      case e_mail:               validateEMail(val, lstInvalidValues);                 break;
      default:                   break;
   }
}
Пример #2
0
static const aiMesh* getValidMesh(const aiMesh* mesh) {
    validateNotNull("mesh", "VertexData::VertexData", mesh);
    return mesh;
}