2016-03-11 14:49:24 +00:00
|
|
|
#ifndef COMMAND_H
|
|
|
|
#define COMMAND_H
|
|
|
|
#include <string>
|
|
|
|
#include <vector>
|
2016-03-12 17:58:01 +00:00
|
|
|
|
2016-03-11 14:49:24 +00:00
|
|
|
using std::string;
|
|
|
|
using std::vector;
|
|
|
|
|
|
|
|
class Command
|
|
|
|
{
|
|
|
|
const string name;
|
|
|
|
static unsigned int numCom;
|
|
|
|
int (*funcCommand)(const vector<string>*);
|
|
|
|
void checkObj();
|
2016-03-12 17:58:01 +00:00
|
|
|
|
2016-03-11 14:49:24 +00:00
|
|
|
public:
|
|
|
|
Command(const string& n, int (*funcptr)(const vector<string>* args));
|
|
|
|
Command(const Command&);
|
|
|
|
~Command();
|
|
|
|
string getName();
|
2016-03-12 17:58:01 +00:00
|
|
|
int execute(const vector<string>*);
|
2016-03-11 14:49:24 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
class CommandNameNotValidException{};
|
|
|
|
|
|
|
|
#endif // COMMAND_H
|