]> git.tdb.fi Git - gldbg.git/blob - source/commandinterpreter.h
8ce59d0a85fc02343908bf3001c21050227ea6f6
[gldbg.git] / source / commandinterpreter.h
1 /* $Id$
2
3 This file is part of gldbg
4 Copyright © 2009  Mikko Rasa, Mikkosoft Productions
5 Distributed under the GPL
6 */
7
8 #ifndef COMMANDINTERPRETER_H_
9 #define COMMANDINTERPRETER_H_
10
11 #include <map>
12 #include <string>
13
14 class GlDbg;
15
16 class CommandInterpreter
17 {
18 private:
19         typedef void (CommandInterpreter::*CommandFunc)(const std::string &);
20         typedef std::map<std::string, CommandFunc> CommandMap;
21
22         GlDbg &gldbg;
23         CommandMap commands;
24
25 public:
26         CommandInterpreter(GlDbg &);
27         void execute(const std::string &);
28
29 private:
30         void cmd_run(const std::string &);
31         void cmd_continue(const std::string &);
32         void cmd_signal(const std::string &);
33         void cmd_kill(const std::string &);
34         void cmd_exit(const std::string &);
35         void cmd_trace(const std::string &);
36 };
37
38 #endif