53 lines
1.0 KiB
C++
53 lines
1.0 KiB
C++
#ifndef __CommandList_h__
|
|
#define __CommandList_h__
|
|
|
|
#include "Session.h"
|
|
#include "Command.h"
|
|
|
|
namespace core {
|
|
|
|
///
|
|
/// CommandList
|
|
///
|
|
/// This object organizes Command objects into a list that is used
|
|
/// to parse an input and run the process associated with the
|
|
/// selected command.
|
|
///
|
|
|
|
class CommandList : public Command {
|
|
|
|
public:
|
|
|
|
///
|
|
/// The constructor for the object.
|
|
///
|
|
|
|
CommandList();
|
|
|
|
///
|
|
/// The destructor for the object.
|
|
///
|
|
|
|
~CommandList();
|
|
|
|
///
|
|
/// Add a new command to the command list and assign a default search value.
|
|
///
|
|
|
|
void add(Command &command, std::string name = "");
|
|
|
|
void remove(Command &command);
|
|
|
|
bool processRequest(std::string request, Session *session);
|
|
|
|
int processCommand(std::string request, Session *session) override;
|
|
|
|
private:
|
|
std::vector<Command *> commands;
|
|
|
|
};
|
|
|
|
}
|
|
|
|
#endif
|