From e6447fa2c40270d2e2435229127dd970194b47d9 Mon Sep 17 00:00:00 2001 From: Adam Date: Thu, 3 Jun 2010 23:09:22 -0400 Subject: Added in a subcommand system and switched ns_set and ns_saset to use it --- include/commands.h | 15 +++++++++++++-- include/hashcomp.h | 3 ++- include/services.h | 2 +- 3 files changed, 16 insertions(+), 4 deletions(-) (limited to 'include') diff --git a/include/commands.h b/include/commands.h index 9e597204e..327d65736 100644 --- a/include/commands.h +++ b/include/commands.h @@ -23,7 +23,7 @@ class Command; typedef std::map CommandMap; /** The return value from commands. - * */ + */ enum CommandReturn { MOD_CONT, @@ -32,7 +32,8 @@ enum CommandReturn extern CoreExport Command *FindCommand(BotInfo *bi, const ci::string &cmd); extern CoreExport void mod_help_cmd(BotInfo *bi, User *u, const ci::string &cmd); -extern CoreExport void mod_run_cmd(BotInfo *bi, User *u, const ci::string &cmd); +extern CoreExport void mod_run_cmd(BotInfo *bi, User *u, const std::string &message); +extern CoreExport void mod_run_cmd(BotInfo *bi, User *u, Command *c, const ci::string &command, const ci::string &message); enum CommandFlag { @@ -101,6 +102,16 @@ class CoreExport Command : public Flags * @param reststr The permission required to successfully execute this command */ void SetPermission(const std::string &reststr); + + /** Add a subcommand to this command + * @param c The command + */ + virtual bool AddSubcommand(Command *c); + + /** Delete a subcommand from this command + * @param cname The subcommand name + */ + virtual bool DelSubcommand(const ci::string &cname); }; #endif diff --git a/include/hashcomp.h b/include/hashcomp.h index a0d456b40..6d4530dc6 100644 --- a/include/hashcomp.h +++ b/include/hashcomp.h @@ -16,7 +16,8 @@ #include #ifndef _WIN32 - #ifdef HASHMAP_DEPRECATED /* If gcc ver > 4.3 */ +// #ifdef HASHMAP_DEPRECATED /* If gcc ver > 4.3 */ + #if 1 /* GCC4.3+ has deprecated hash_map and uses tr1. But of course, uses a different include to MSVC. */ #include #define unordered_map_namespace std::tr1 diff --git a/include/services.h b/include/services.h index 9a7356bd2..4994984e0 100644 --- a/include/services.h +++ b/include/services.h @@ -52,7 +52,7 @@ #include /* for umask() on some systems */ #include - +#include #include #ifndef _WIN32 -- cgit