This class implements the BPS table field validator. More...
#include <bpsfieldvalidator.h>
Public Types | |
| enum | Status { StatusOK, StatusMissing, StatusInvalid, StatusDuplicate, StatusBadRef, StatusNotPositive, StatusUnknown } |
| Return status from check function. More... | |
Public Member Functions | |
| BpsFieldValidator (BpsDatastore *aDatastore, const QString &aTable) | |
| bool | checkDelete (const QVariantMap &aValues) |
| Checks if the record data is valid to delete. | |
| bool | checkInsert (const QVariantMap &aValues) |
| Checks if the record data is valid for insertion. | |
| bool | checkUpdate (const QVariantMap &aValues) |
| Checks if the record data is valid for update. | |
| QString | lastColumn () const |
| Status | lastStatus () const |
| virtual QString | message (Status aStatus) |
| Get standard message for a status. | |
This class implements the BPS table field validator.
Return status from check function.
| BpsFieldValidator::BpsFieldValidator | ( | BpsDatastore * | aDatastore, |
| const QString & | aTable | ||
| ) |
| aDatastore | The datastore connection to use. |
| aTable | The name of the table to validate for. |
| bool BpsFieldValidator::checkDelete | ( | const QVariantMap & | aValues | ) |
Checks if the record data is valid to delete.
Stops on first fail and sets the values for lastStatus() and lastColumn().
| aValues | List of column name / value pairs for the record to check. |
| BpsException | Thrown when db access fails or validator is broken. |
| bool BpsFieldValidator::checkInsert | ( | const QVariantMap & | aValues | ) |
Checks if the record data is valid for insertion.
Stops on first fail and sets the values for lastStatus() and lastColumn().
| aValues | List of column name / value pairs for the record to check. |
| BpsException | Thrown when db access fails or validator is broken. |
| bool BpsFieldValidator::checkUpdate | ( | const QVariantMap & | aValues | ) |
Checks if the record data is valid for update.
Stops on first fail and sets the values for lastStatus() and lastColumn().
| aValues | List of column name / value pairs for the record to check. |
| BpsException | Thrown when db access fails or validator is broken. |
| QString BpsFieldValidator::lastColumn | ( | ) | const |
| Status BpsFieldValidator::lastStatus | ( | ) | const |
| virtual QString BpsFieldValidator::message | ( | Status | aStatus | ) | [virtual] |
Get standard message for a status.
| aStatus | The status to get the message for. |