2008-08-31 09:08:24 +00:00
|
|
|
#ifndef MIRC_SCRIPT_H
|
|
|
|
#define MIRC_SCRIPT_H
|
|
|
|
|
|
|
|
#include <QObject>
|
|
|
|
#include <QString>
|
|
|
|
#include <QMap>
|
|
|
|
#include "mirc.h"
|
|
|
|
#include "parser.h"
|
|
|
|
|
|
|
|
class MIRCScript : public QObject {
|
|
|
|
Q_OBJECT
|
|
|
|
private:
|
2008-08-31 09:50:57 +00:00
|
|
|
MIRCScriptManager *manager;
|
2008-08-31 09:08:24 +00:00
|
|
|
QString script;
|
|
|
|
QMap<QString, mirc_alias> _aliases;
|
|
|
|
QMap<QString, QString> _variables;
|
2009-04-17 02:45:22 +00:00
|
|
|
mirc_script_engine *interpreter;
|
|
|
|
mirc_script *parser;
|
2009-05-05 18:14:05 +00:00
|
|
|
iterator_t *begin;
|
|
|
|
iterator_t *end;
|
2008-08-31 09:08:24 +00:00
|
|
|
bool loaded;
|
|
|
|
public:
|
2008-08-31 09:50:57 +00:00
|
|
|
MIRCScript(MIRCScriptManager *m);
|
2008-08-31 09:08:24 +00:00
|
|
|
bool load(QString filename);
|
|
|
|
bool parse(QString script);
|
|
|
|
bool run();
|
|
|
|
bool run(QString alias);
|
|
|
|
QString code();
|
|
|
|
QString code(QString alias);
|
2009-05-05 18:14:05 +00:00
|
|
|
int line();
|
2008-08-31 09:08:24 +00:00
|
|
|
QMap<QString, mirc_alias> aliases();
|
|
|
|
QMap<QString, QString> variables();
|
|
|
|
};
|
|
|
|
|
|
|
|
#endif
|