12345678910111213141516171819202122232425262728293031323334 |
- /*!
- * \file include/commands/Command.h
- * \brief Command interface
- *
- * \author xythobuz
- */
-
- #ifndef _COMMAND_H_
- #define _COMMAND_H_
-
- #include <istream>
- #include <memory>
- #include <string>
- #include <vector>
-
- class Command {
- public:
- virtual ~Command();
- virtual std::string name() = 0;
- virtual std::string brief() = 0;
- virtual void printHelp();
- virtual int execute(std::istream& args) = 0;
-
- static void fillCommandList();
- static int command(std::string c);
- static int executeFile(std::string file);
- static std::string autoComplete(std::string begin);
-
- private:
- static std::vector<std::shared_ptr<Command>> commands;
- };
-
- #endif
|