]> git.localhorst.tv Git - blank.git/blob - src/shared/CLI.hpp
ab1e3eeaad60deaa701dd34850e674a546aa5c5c
[blank.git] / src / shared / CLI.hpp
1 #ifndef BLANK_SHARED_CLI_HPP_
2 #define BLANK_SHARED_CLI_HPP_
3
4 #include <map>
5 #include <string>
6
7
8 namespace blank {
9
10 class CLIContext;
11 class TokenStreamReader;
12 class World;
13
14 class CLI {
15
16 public:
17         struct Command {
18                 virtual ~Command();
19                 virtual void Execute(CLI &, CLIContext &, TokenStreamReader &) = 0;
20         };
21
22 public:
23         explicit CLI(World &);
24         ~CLI();
25
26         void AddCommand(const std::string &name, Command *);
27
28         void Execute(CLIContext &, const std::string &);
29
30 private:
31         World &world;
32         std::map<std::string, Command *> commands;
33
34 };
35
36 }
37
38 #endif