diff options
author | Naram Qashat <cyberbotx@cyberbotx.com> | 2010-07-25 21:58:20 -0400 |
---|---|---|
committer | Naram Qashat <cyberbotx@cyberbotx.com> | 2010-07-25 21:58:20 -0400 |
commit | ae38212c1ce829c783edf971081c90137abb49a0 (patch) | |
tree | 5c652d9cdc38103dec6fa112d57fca882b4e3e44 /include/commands.h | |
parent | 15d7f0f6fe8bb903275f603f734c13f65f3aa906 (diff) |
Epic commit to replace most of the strings in Anope with a single Anope::string class, plus some other little fixes here and there. If you follow 1.9.x development and are testing things, THIS is one of those things that NEEDS testing.
Diffstat (limited to 'include/commands.h')
-rw-r--r-- | include/commands.h | 26 |
1 files changed, 13 insertions, 13 deletions
diff --git a/include/commands.h b/include/commands.h index cfe2eddab..71fee7e42 100644 --- a/include/commands.h +++ b/include/commands.h @@ -18,7 +18,7 @@ class Module; class BotInfo; class Command; -typedef std::map<ci::string, Command *> CommandMap; +typedef std::map<Anope::string, Command *, hash_compare_ci_string> CommandMap; /** The return value from commands. */ @@ -28,10 +28,10 @@ enum CommandReturn MOD_STOP }; -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 std::string &message); -extern CoreExport void mod_run_cmd(BotInfo *bi, User *u, Command *c, const ci::string &command, const ci::string &message); +extern CoreExport Command *FindCommand(BotInfo *bi, const Anope::string &cmd); +extern CoreExport void mod_help_cmd(BotInfo *bi, User *u, const Anope::string &cmd); +extern CoreExport void mod_run_cmd(BotInfo *bi, User *u, const Anope::string &message); +extern CoreExport void mod_run_cmd(BotInfo *bi, User *u, Command *c, const Anope::string &command, const Anope::string &message); enum CommandFlag { @@ -53,9 +53,9 @@ class CoreExport Command : public Flags<CommandFlag> /* Minimum parameters required to use this command */ size_t MinParams; /* Command name */ - ci::string name; + Anope::string name; /* Permission needed to use this comand */ - ci::string permission; + Anope::string permission; /* Module which owns us */ Module *module; @@ -68,14 +68,14 @@ class CoreExport Command : public Flags<CommandFlag> * @param max_params The maximum number of parameters the parser will create, after max_params, all will be combined into the last argument. * NOTE: If max_params is not set (default), there is no limit to the max number of params. */ - Command(const ci::string &sname, size_t min_params, size_t max_params = 0, const ci::string &spermission = ""); + Command(const Anope::string &sname, size_t min_params, size_t max_params = 0, const Anope::string &spermission = ""); virtual ~Command(); /** Execute this command. * @param u The user executing the command. */ - virtual CommandReturn Execute(User *u, const std::vector<ci::string> &); + virtual CommandReturn Execute(User *u, const std::vector<Anope::string> &); /** Called when HELP is requsted for the client this command is on. * @param u The user requesting help @@ -87,18 +87,18 @@ class CoreExport Command : public Flags<CommandFlag> * @param subcommand The subcommand the user is requesting help on, or an empty string. (e.g. /ns help set foo bar lol gives a subcommand of "FOO BAR LOL") * @return true if help was provided to the user, false otherwise. */ - virtual bool OnHelp(User *u, const ci::string &subcommand); + virtual bool OnHelp(User *u, const Anope::string &subcommand); /** Requested when the user provides bad syntax to this command (not enough params, etc). * @param u The user executing the command. * @param subcommand The subcommand the user tried to use */ - virtual void OnSyntaxError(User *u, const ci::string &subcommand); + virtual void OnSyntaxError(User *u, const Anope::string &subcommand); /** Set which command permission (e.g. chanserv/forbid) is required for this command. * @param reststr The permission required to successfully execute this command */ - void SetPermission(const ci::string &reststr); + void SetPermission(const Anope::string &reststr); /** Add a subcommand to this command * @param c The command @@ -108,7 +108,7 @@ class CoreExport Command : public Flags<CommandFlag> /** Delete a subcommand from this command * @param cname The subcommand name */ - virtual bool DelSubcommand(const ci::string &cname); + virtual bool DelSubcommand(const Anope::string &cname); }; #endif // COMMANDS_H |