This repository was archived by the owner on Aug 13, 2018. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathConditionChecker.h
More file actions
52 lines (44 loc) · 1.33 KB
/
ConditionChecker.h
File metadata and controls
52 lines (44 loc) · 1.33 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
#ifndef CONDITIONCHECKER_H
#define CONDITIONCHECKER_H
#include <QtScript/QScriptEngine>
#include <QDebug>
#include <QString>
#include <QObject>
#include <QScriptValue>
#include "Condition.h"
#include <string>
#include "uv.h"
#include <vector>
class Dossier;
class ConditionCheckerException : public std::exception
{
protected :
std::string info;
public:
ConditionCheckerException(const std::string& i="") throw() :info(i) {}
const char* what() const throw()
{
return info.c_str();
}
~ConditionCheckerException()throw() {}
};
class ConditionChecker: public QObject
{
Q_OBJECT
private:
QString name;
std::vector<Condition> cond;
QScriptEngine engine;
Dossier& dossier;
public:
ConditionChecker(std::vector<Condition> c,QString n,Dossier& d):name(n),cond(c),dossier(d){}
bool evaluate();
public slots:
/*
*Warning !!! Les slots ne peuvent prendre en paramêtre que les types supporté par QScript : faire un maximum de conversion dans les fonctions C++(ou implémenter la conversion des customs types si besoin)
*/
bool isUvValidated(QString u);
unsigned int getValidatedCredits(QString c);
//UV test(int x){qDebug()<<"##################### test "<<x<<" UV "<<QString::fromStdString( StringToUV("EE32").getCode()); return StringToUV("EE32");}
};
#endif // CONDITIONCHECKER_H