Class for validation. More...
#include <kockpitvalidator.h>
Public Member Functions | |
KockpitValidator (QObject *parent=0) | |
Constructor. | |
virtual | ~KockpitValidator () |
Destructor. | |
Q_INVOKABLE void | appendValidationObj (const QString &item, const QString &errmsg, int errcode) |
Append Validation Object. | |
void | computeErrState (QStringList *result=NULL) |
Compute Error State. | |
void | clear () |
Clear Error List. | |
validationResult | getErrState () const |
Getter. | |
Private Attributes | |
QList< KockpitValidationObj > | vallist |
List of validated items. | |
validationResult | errstate |
Main errorstate - one defective entry in vallist indicates a negative error state. | |
Friends | |
std::ostream & | operator<< (std::ostream &output, const KockpitValidator &validator) |
Output. |
Class for validation.
This class handles all actions in association with validation.
KockpitValidator::KockpitValidator | ( | QObject * | parent = 0 |
) |
virtual KockpitValidator::~KockpitValidator | ( | ) | [inline, virtual] |
Destructor.
void KockpitValidator::appendValidationObj | ( | const QString & | item, | |
const QString & | errmsg, | |||
int | errcode | |||
) |
Append Validation Object.
Calling this function a new validation result will be added to list. This function is callable in a javascript file.
item | Item which was validated. | |
errmsg | Error message. | |
errcode | Error code. |
void KockpitValidator::clear | ( | ) |
Clear Error List.
This function resets vallist.
void KockpitValidator::computeErrState | ( | QStringList * | result = NULL |
) |
Compute Error State.
This function iterates over vallist and determines the error state. If errors occured it is possible to add them to a QStringList which is hand over as a parameter.
result | Result Error Messages. |
validationResult KockpitValidator::getErrState | ( | ) | const |
Getter.
Get the current error state.
std::ostream& operator<< | ( | std::ostream & | output, | |
const KockpitValidator & | validator | |||
) | [friend] |
Output.
This function is only needed to give out the KockpitValidator on STDOUT.
output | Reference to stdout. | |
validator | Reference to an KockpitValidator object. |
validationResult KockpitValidator::errstate [private] |
Main errorstate - one defective entry in vallist indicates a negative error state.
QList<KockpitValidationObj> KockpitValidator::vallist [private] |
List of validated items.