summaryrefslogtreecommitdiff
path: root/include/command_parse.h
diff options
context:
space:
mode:
authorAttila Molnar <attilamolnar@hush.com>2014-06-13 15:40:03 +0200
committerAttila Molnar <attilamolnar@hush.com>2014-06-13 15:40:03 +0200
commit085a8a34cb0b1bd97bba76fff15820fb57aa50e4 (patch)
treeedbbb57fa80ac5da15b8c41e9c85976c4ff2414b /include/command_parse.h
parent7f878af39e659176677913890e143a247add7bdc (diff)
Add CommandParser::GetCommands() and typedef CommandMap and use it instead of directly accessing cmdlist
Diffstat (limited to 'include/command_parse.h')
-rw-r--r--include/command_parse.h8
1 files changed, 8 insertions, 0 deletions
diff --git a/include/command_parse.h b/include/command_parse.h
index 70544b0c8..bdbc12757 100644
--- a/include/command_parse.h
+++ b/include/command_parse.h
@@ -29,6 +29,9 @@
*/
class CoreExport CommandParser
{
+ public:
+ typedef Commandtable CommandMap;
+
private:
/** Process a command from a user.
* @param user The user to parse the command for
@@ -45,6 +48,11 @@ class CoreExport CommandParser
*/
CommandParser();
+ /** Get a command name -> Command* map containing all client to server commands
+ * @return A map of command handlers keyed by command names
+ */
+ const CommandMap& GetCommands() const { return cmdlist; }
+
/** Calls the handler for a given command.
* @param commandname The command to find. This should be in uppercase.
* @param parameters Parameter list