29 lines
685 B
C++
29 lines
685 B
C++
#ifndef COMMAND_H
|
|
#define COMMAND_H
|
|
#include <string>
|
|
#include <vector>
|
|
#include "shell.h"
|
|
#include "commandexecutor.h"
|
|
|
|
using std::string;
|
|
using std::vector;
|
|
|
|
namespace mshconsole{
|
|
class Command
|
|
{
|
|
const string name;
|
|
static unsigned int numCom;
|
|
int (*funcCommand)(const vector<string>*,CommandExecutor*);
|
|
void checkObj();
|
|
|
|
public:
|
|
Command(const string& n, int (*funcptr)(const vector<string>* args, CommandExecutor*));
|
|
Command(const Command&);
|
|
~Command();
|
|
string getName();
|
|
int execute(const vector<string>*, CommandExecutor* ciao);
|
|
};
|
|
}
|
|
class CommandNameNotValidException{};
|
|
|
|
#endif // COMMAND_H
|