#ifndef MOD_TESTER_H
#define MOD_TESTER_H
// This file is part of MRCI.
// MRCI is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
// MRCI is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
// You should have received a copy of the GNU General Public License
// along with MRCI under the LICENSE.md file. If not, see
// .
#include
#include
#include
#include "command.h"
#define IMPORT_REV 3
// the import revision is a module compatibility version number
// used by the host to determine if it can successfully load and
// run this library or not. as of right now, the host supports rev1
// and up.
#define LIB_VERSION "1.0.1"
#define LIB_NAME "MRCITestMod"
// the versioning system for the library itself can be completely
// different from the host import revision.
#if defined(MOD_TESTER)
# define MOD_TESTER_EXPORT Q_DECL_EXPORT
#else
# define MOD_TESTER_EXPORT Q_DECL_IMPORT
#endif
extern "C" MOD_TESTER_EXPORT CommandLoader *hostImport();
QString libName();
class Loader : public CommandLoader
{
Q_OBJECT
private:
QString err;
public:
bool hostRevOk(quint64 minRev, quint16 vMajor, quint16 vMinor, quint16 vPatch);
quint64 rev();
ExternCommand *cmdObj(const QString &name);
QStringList cmdList();
QString lastError();
explicit Loader(QObject *parent = nullptr);
};
//-----------------
class ModText : public ExternCommand
{
Q_OBJECT
public:
explicit ModText(QObject *parent = nullptr);
void procBin(const SharedObjs *sharedObjs, const QByteArray &data, uchar dType);
QString shortText();
QString ioText();
QString longText();
QString libText();
};
//--------------------
class ModInput : public ExternCommand
{
Q_OBJECT
public:
explicit ModInput(QObject *parent = nullptr);
void procBin(const SharedObjs *sharedObjs, const QByteArray &data, uchar dType);
QString shortText();
QString ioText();
QString longText();
QString libText();
};
//-----------------------
class ModLoop : public ExternCommand
{
Q_OBJECT
private:
int index;
public:
explicit ModLoop(QObject *parent = nullptr);
void term();
void procBin(const SharedObjs *sharedObjs, const QByteArray &data, uchar dType);
QString shortText();
QString ioText();
QString longText();
QString libText();
};
//--------------------------
class ModInherit : public ExternCommand
{
Q_OBJECT
public:
explicit ModInherit(QObject *parent = nullptr);
void procBin(const SharedObjs *sharedObjs, const QByteArray &data, uchar dType);
QString shortText();
QString ioText();
QString longText();
QString libText();
QStringList internRequest();
};
#endif // MOD_TESTER_H