summaryrefslogtreecommitdiffstats
path: root/src/Client/CommandParser.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/Client/CommandParser.h')
-rw-r--r--src/Client/CommandParser.h19
1 files changed, 18 insertions, 1 deletions
diff --git a/src/Client/CommandParser.h b/src/Client/CommandParser.h
index 81c3289..8b3cc69 100644
--- a/src/Client/CommandParser.h
+++ b/src/Client/CommandParser.h
@@ -38,6 +38,17 @@ namespace Client {
class CommandParser {
private:
+ struct Command {
+ const char* command;
+ const char* cmdline;
+ const char* desc;
+ const char* longdesc;
+
+ void (CommandParser::*funcPtr) (const std::vector<std::string> &args);
+ };
+
+ static const Command commands[];
+
sigc::signal<void> finished;
Common::RequestManager *requestManager;
@@ -54,6 +65,10 @@ class CommandParser {
finished();
}
+ void helpCommand(const std::vector<std::string> &args);
+ void statusCommand(const std::vector<std::string>&);
+ void quitCommand(const std::vector<std::string>&);
+
public:
CommandParser(Common::RequestManager *requestManager0, Net::Connection *connection0) : requestManager(requestManager0), connection(connection0), activeRequests(0), disconnect(false) {}
@@ -62,7 +77,9 @@ class CommandParser {
bool parse(const std::string &cmd);
- void requestDisconnect();
+ void requestDisconnect() {
+ quitCommand(std::vector<std::string>());
+ }
sigc::signal<void> signalFinished() const {return finished;}
};