Open Source Tomb Raider Engine
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

12345678910111213141516171819202122232425262728293031323334
  1. /*!
  2. * \file include/commands/Command.h
  3. * \brief Command interface
  4. *
  5. * \author xythobuz
  6. */
  7. #ifndef _COMMAND_H_
  8. #define _COMMAND_H_
  9. #include <istream>
  10. #include <memory>
  11. #include <string>
  12. #include <vector>
  13. class Command {
  14. public:
  15. virtual ~Command();
  16. virtual std::string name() = 0;
  17. virtual std::string brief() = 0;
  18. virtual void printHelp();
  19. virtual int execute(std::istream& args) = 0;
  20. static void fillCommandList();
  21. static int command(std::string c);
  22. static int executeFile(std::string file);
  23. static std::string autoComplete(std::string begin);
  24. private:
  25. static std::vector<std::shared_ptr<Command>> commands;
  26. };
  27. #endif