1
0
mirror of https://github.com/anope/anope.git synced 2026-07-09 13:43:14 +02:00

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.

This commit is contained in:
Naram Qashat
2010-07-25 21:58:20 -04:00
parent 15d7f0f6fe
commit ae38212c1c
232 changed files with 7424 additions and 8911 deletions
+15 -14
View File
@@ -15,21 +15,22 @@
class CommandCSSet : public Command
{
std::map<ci::string, Command *> subcommands;
typedef std::map<Anope::string, Command *, hash_compare_ci_string> subcommand_map;
subcommand_map subcommands;
public:
CommandCSSet(const ci::string &cname) : Command(cname, 2, 3)
CommandCSSet(const Anope::string &cname) : Command(cname, 2, 3)
{
}
~CommandCSSet()
{
for (std::map<ci::string, Command *>::const_iterator it = this->subcommands.begin(), it_end = this->subcommands.end(); it != it_end; ++it)
for (subcommand_map::const_iterator it = this->subcommands.begin(), it_end = this->subcommands.end(); it != it_end; ++it)
delete it->second;
this->subcommands.clear();
}
CommandReturn Execute(User *u, const std::vector<ci::string> &params)
CommandReturn Execute(User *u, const std::vector<Anope::string> &params)
{
if (readonly)
{
@@ -46,26 +47,26 @@ class CommandCSSet : public Command
if (c)
{
ci::string cmdparams = cs_findchan(params[0])->name.c_str();
for (std::vector<ci::string>::const_iterator it = params.begin() + 2, it_end = params.end(); it != it_end; ++it)
Anope::string cmdparams = cs_findchan(params[0])->name;
for (std::vector<Anope::string>::const_iterator it = params.begin() + 2, it_end = params.end(); it != it_end; ++it)
cmdparams += " " + *it;
mod_run_cmd(ChanServ, u, c, params[1], cmdparams);
}
else
{
notice_lang(Config.s_ChanServ, u, CHAN_SET_UNKNOWN_OPTION, params[1].c_str());
notice_lang(Config.s_ChanServ, u, MORE_INFO, Config.s_ChanServ, "SET");
notice_lang(Config.s_ChanServ, u, MORE_INFO, Config.s_ChanServ.c_str(), "SET");
}
return MOD_CONT;
}
bool OnHelp(User *u, const ci::string &subcommand)
bool OnHelp(User *u, const Anope::string &subcommand)
{
if (subcommand.empty())
{
notice_help(Config.s_ChanServ, u, CHAN_HELP_SET_HEAD);
for (std::map<ci::string, Command *>::iterator it = this->subcommands.begin(), it_end = this->subcommands.end(); it != it_end; ++it)
for (subcommand_map::iterator it = this->subcommands.begin(), it_end = this->subcommands.end(); it != it_end; ++it)
it->second->OnServHelp(u);
notice_help(Config.s_ChanServ, u, CHAN_HELP_SET_TAIL);
return true;
@@ -81,7 +82,7 @@ class CommandCSSet : public Command
return false;
}
void OnSyntaxError(User *u, const ci::string &subcommand)
void OnSyntaxError(User *u, const Anope::string &subcommand)
{
syntax_error(Config.s_ChanServ, u, "SET", CHAN_SET_SYNTAX);
}
@@ -96,14 +97,14 @@ class CommandCSSet : public Command
return this->subcommands.insert(std::make_pair(c->name, c)).second;
}
bool DelSubcommand(const ci::string &command)
bool DelSubcommand(const Anope::string &command)
{
return this->subcommands.erase(command);
}
Command *FindCommand(const ci::string &subcommand)
Command *FindCommand(const Anope::string &subcommand)
{
std::map<ci::string, Command *>::const_iterator it = this->subcommands.find(subcommand);
subcommand_map::const_iterator it = this->subcommands.find(subcommand);
if (it != this->subcommands.end())
return it->second;
@@ -115,7 +116,7 @@ class CommandCSSet : public Command
class CSSet : public Module
{
public:
CSSet(const std::string &modname, const std::string &creator) : Module(modname, creator)
CSSet(const Anope::string &modname, const Anope::string &creator) : Module(modname, creator)
{
this->SetAuthor("Anope");
this->SetType(CORE);