diff options
author | Adam <Adam@anope.org> | 2013-05-05 21:05:43 -0400 |
---|---|---|
committer | Adam <Adam@anope.org> | 2013-05-05 21:05:43 -0400 |
commit | 5b3f81ea78f7a8ab69ff94cbf2bbf07f5966682e (patch) | |
tree | 3536557fea79ffd77bb5a885465e579eeeafb8ff | |
parent | 3e8752fe665c3cdf683f2b5fa271231fb3a624df (diff) |
That doesn't work either, just don't use references.
find ./ -name '*.cpp' -exec sed -i 's/Get<const Anope::string\&>/Get<const Anope::string>/g' {} \;
64 files changed, 260 insertions, 266 deletions
diff --git a/include/config.h b/include/config.h index 5d9005f63..194b7fe74 100644 --- a/include/config.h +++ b/include/config.h @@ -49,7 +49,7 @@ namespace Configuration */ template<typename T> T Get(const Anope::string &tag, const Anope::string &def) const { - const Anope::string &value = this->Get<const Anope::string &>(tag, def); + const Anope::string &value = this->Get<const Anope::string>(tag, def); try { return convertTo<T>(value); @@ -64,7 +64,7 @@ namespace Configuration const item_map* GetItems() const; }; - template<> CoreExport const Anope::string& Block::Get(const Anope::string &tag, const Anope::string& def) const; + template<> CoreExport const Anope::string Block::Get(const Anope::string &tag, const Anope::string& def) const; template<> CoreExport time_t Block::Get(const Anope::string &tag, const Anope::string &def) const; template<> CoreExport const char* Block::Get(const Anope::string &tag, const Anope::string &def) const; template<> CoreExport bool Block::Get(const Anope::string &tag, const Anope::string &def) const; diff --git a/modules/bs_autoassign.cpp b/modules/bs_autoassign.cpp index 3604fe69b..ae60f5b5a 100644 --- a/modules/bs_autoassign.cpp +++ b/modules/bs_autoassign.cpp @@ -20,7 +20,7 @@ class BSAutoAssign : public Module void OnChanRegistered(ChannelInfo *ci) anope_override { - const Anope::string &bot = Config->GetModule(this)->Get<const Anope::string &>("bot"); + const Anope::string &bot = Config->GetModule(this)->Get<const Anope::string>("bot"); if (bot.empty()) return; diff --git a/modules/commands/cs_access.cpp b/modules/commands/cs_access.cpp index de434337b..88dd751c3 100644 --- a/modules/commands/cs_access.cpp +++ b/modules/commands/cs_access.cpp @@ -801,13 +801,13 @@ class CSAccess : public Module { Configuration::Block *priv = conf->GetBlock("privilege", i); - const Anope::string &pname = priv->Get<const Anope::string &>("name"); + const Anope::string &pname = priv->Get<const Anope::string>("name"); Privilege *p = PrivilegeManager::FindPrivilege(pname); if (p == NULL) continue; - const Anope::string &value = priv->Get<const Anope::string &>("level"); + const Anope::string &value = priv->Get<const Anope::string>("level"); if (value.empty()) continue; else if (value.equals_ci("founder")) diff --git a/modules/commands/cs_akick.cpp b/modules/commands/cs_akick.cpp index bb1e6ecd6..51665d309 100644 --- a/modules/commands/cs_akick.cpp +++ b/modules/commands/cs_akick.cpp @@ -546,7 +546,7 @@ class CSAKick : public Module mask = autokick->mask; reason = autokick->reason; if (reason.empty()) - reason = Config->GetModule(this)->Get<const Anope::string &>("autokickreason"); + reason = Config->GetModule(this)->Get<const Anope::string>("autokickreason"); if (reason.empty()) reason = "User has been banned from the channel"; return EVENT_STOP; diff --git a/modules/commands/cs_fantasy_stats.cpp b/modules/commands/cs_fantasy_stats.cpp index 381063c34..b8c83e73b 100644 --- a/modules/commands/cs_fantasy_stats.cpp +++ b/modules/commands/cs_fantasy_stats.cpp @@ -79,10 +79,10 @@ class CSStats : public Module void OnReload(Configuration::Conf *conf) anope_override { - prefix = conf->GetModule(this)->Get<const Anope::string &>("prefix"); + prefix = conf->GetModule(this)->Get<const Anope::string>("prefix"); if (prefix.empty()) prefix = "anope_"; - this->sql = ServiceReference<SQL::Provider>("SQL::Provider", conf->GetModule(this)->Get<const Anope::string &>("engine")); + this->sql = ServiceReference<SQL::Provider>("SQL::Provider", conf->GetModule(this)->Get<const Anope::string>("engine")); } SQL::Result RunQuery(const SQL::Query &query) diff --git a/modules/commands/cs_fantasy_top.cpp b/modules/commands/cs_fantasy_top.cpp index a3e35eb3c..7f82ba221 100644 --- a/modules/commands/cs_fantasy_top.cpp +++ b/modules/commands/cs_fantasy_top.cpp @@ -104,10 +104,10 @@ class CSTop : public Module void OnReload(Configuration::Conf *conf) anope_override { - prefix = conf->GetModule(this)->Get<const Anope::string &>("prefix"); + prefix = conf->GetModule(this)->Get<const Anope::string>("prefix"); if (prefix.empty()) prefix = "anope_"; - this->sql = ServiceReference<SQL::Provider>("SQL::Provider", conf->GetModule(this)->Get<const Anope::string &>("engine")); + this->sql = ServiceReference<SQL::Provider>("SQL::Provider", conf->GetModule(this)->Get<const Anope::string>("engine")); } SQL::Result RunQuery(const SQL::Query &query) diff --git a/modules/commands/cs_flags.cpp b/modules/commands/cs_flags.cpp index 8ed4cc8c6..18b72ef29 100644 --- a/modules/commands/cs_flags.cpp +++ b/modules/commands/cs_flags.cpp @@ -406,13 +406,13 @@ class CSFlags : public Module { Configuration::Block *priv = conf->GetBlock("privilege", i); - const Anope::string &pname = priv->Get<const Anope::string &>("name"); + const Anope::string &pname = priv->Get<const Anope::string>("name"); Privilege *p = PrivilegeManager::FindPrivilege(pname); if (p == NULL) continue; - const Anope::string &value = priv->Get<const Anope::string &>("flag"); + const Anope::string &value = priv->Get<const Anope::string>("flag"); if (value.empty()) continue; diff --git a/modules/commands/cs_list.cpp b/modules/commands/cs_list.cpp index 5d0f16f60..9718b73a1 100644 --- a/modules/commands/cs_list.cpp +++ b/modules/commands/cs_list.cpp @@ -151,7 +151,7 @@ class CommandCSList : public Command " \002LIST #51-100\002\n" " Lists all registered channels within the given range (51-100).")); - if (!Config->GetBlock("options")->Get<const Anope::string &>("regexengine").empty()) + if (!Config->GetBlock("options")->Get<const Anope::string>("regexengine").empty()) { source.Reply(" "); source.Reply(_("Regex matches are also supported using the %s engine.\n" diff --git a/modules/commands/cs_set_misc.cpp b/modules/commands/cs_set_misc.cpp index 325b652cd..9402f5b78 100644 --- a/modules/commands/cs_set_misc.cpp +++ b/modules/commands/cs_set_misc.cpp @@ -150,11 +150,11 @@ class CSSetMisc : public Module { Configuration::Block *block = conf->GetBlock("command", i); - if (block->Get<const Anope::string &>("command") != "chanserv/set/misc") + if (block->Get<const Anope::string>("command") != "chanserv/set/misc") continue; - Anope::string cname = block->Get<const Anope::string &>("name"); - Anope::string desc = block->Get<const Anope::string &>("misc_description"); + Anope::string cname = block->Get<const Anope::string>("name"); + Anope::string desc = block->Get<const Anope::string>("misc_description"); if (cname.empty() || desc.empty()) continue; diff --git a/modules/commands/cs_xop.cpp b/modules/commands/cs_xop.cpp index 1e1cd0646..9efde866c 100644 --- a/modules/commands/cs_xop.cpp +++ b/modules/commands/cs_xop.cpp @@ -557,13 +557,13 @@ class CSXOP : public Module for (int i = 0; i < conf->CountBlock("privilege"); ++i) { Configuration::Block *block = conf->GetBlock("privilege", i); - const Anope::string &pname = block->Get<const Anope::string &>("name"); + const Anope::string &pname = block->Get<const Anope::string>("name"); Privilege *p = PrivilegeManager::FindPrivilege(pname); if (p == NULL) continue; - const Anope::string &xop = block->Get<const Anope::string &>("xop"); + const Anope::string &xop = block->Get<const Anope::string>("xop"); if (pname.empty() || xop.empty()) continue; @@ -573,8 +573,8 @@ class CSXOP : public Module for (int i = 0; i < conf->CountBlock("command"); ++i) { Configuration::Block *block = conf->GetBlock("command", i); - const Anope::string &cname = block->Get<const Anope::string &>("name"), - &cserv = block->Get<const Anope::string &>("command"); + const Anope::string &cname = block->Get<const Anope::string>("name"), + &cserv = block->Get<const Anope::string>("command"); if (cname.empty() || cserv != "chanserv/xop") continue; diff --git a/modules/commands/ns_group.cpp b/modules/commands/ns_group.cpp index cca6cd91c..97551cfcb 100644 --- a/modules/commands/ns_group.cpp +++ b/modules/commands/ns_group.cpp @@ -117,7 +117,7 @@ class CommandNSGroup : public Command } NickAlias *target, *na = NickAlias::Find(u->nick); - const Anope::string &guestnick = Config->GetBlock("options")->Get<const Anope::string &>("guestnickprefix"); + const Anope::string &guestnick = Config->GetBlock("options")->Get<const Anope::string>("guestnickprefix"); time_t reg_delay = Config->GetModule("nickserv")->Get<time_t>("regdelay"); if (!(target = NickAlias::Find(nick))) source.Reply(NICK_X_NOT_REGISTERED, nick.c_str()); diff --git a/modules/commands/ns_list.cpp b/modules/commands/ns_list.cpp index 88d5929eb..69648c2f4 100644 --- a/modules/commands/ns_list.cpp +++ b/modules/commands/ns_list.cpp @@ -167,7 +167,7 @@ class CommandNSList : public Command " \002LIST #51-100\002\n" " Lists all registered nicks within the given range (51-100).")); - const Anope::string ®exengine = Config->GetBlock("options")->Get<const Anope::string &>("regexengine"); + const Anope::string ®exengine = Config->GetBlock("options")->Get<const Anope::string>("regexengine"); if (!regexengine.empty()) { source.Reply(" "); diff --git a/modules/commands/ns_register.cpp b/modules/commands/ns_register.cpp index a9dbce470..6da7d4db1 100644 --- a/modules/commands/ns_register.cpp +++ b/modules/commands/ns_register.cpp @@ -116,7 +116,7 @@ class CommandNSRegister : public Command size_t nicklen = u_nick.length(); Anope::string pass = params[0]; Anope::string email = params.size() > 1 ? params[1] : ""; - const Anope::string &nsregister = Config->GetModule(this->owner)->Get<const Anope::string &>("registration"); + const Anope::string &nsregister = Config->GetModule(this->owner)->Get<const Anope::string>("registration"); if (Anope::ReadOnly) { @@ -143,7 +143,7 @@ class CommandNSRegister : public Command /* Guest nick can now have a series of between 1 and 7 digits. * --lara */ - const Anope::string &guestnick = Config->GetBlock("options")->Get<const Anope::string &>("guestnickprefix"); + const Anope::string &guestnick = Config->GetBlock("options")->Get<const Anope::string>("guestnickprefix"); if (nicklen <= guestnick.length() + 7 && nicklen >= guestnick.length() + 1 && !u_nick.find_ci(guestnick) && u_nick.substr(guestnick.length()).find_first_not_of("1234567890") == Anope::string::npos) { source.Reply(NICK_CANNOT_BE_REGISTERED, u_nick.c_str()); @@ -290,7 +290,7 @@ class CommandNSResend : public Command void Execute(CommandSource &source, const std::vector<Anope::string> ¶ms) anope_override { - if (!Config->GetModule(this->owner)->Get<const Anope::string &>("registration").equals_ci("mail")) + if (!Config->GetModule(this->owner)->Get<const Anope::string>("registration").equals_ci("mail")) return; const NickAlias *na = NickAlias::Find(source.GetNick()); @@ -318,7 +318,7 @@ class CommandNSResend : public Command bool OnHelp(CommandSource &source, const Anope::string &subcommand) anope_override { - if (!Config->GetModule(this->owner)->Get<const Anope::string &>("registration").equals_ci("mail")) + if (!Config->GetModule(this->owner)->Get<const Anope::string>("registration").equals_ci("mail")) return false; this->SendSyntax(source); @@ -330,7 +330,7 @@ class CommandNSResend : public Command void OnServHelp(CommandSource &source) anope_override { - if (Config->GetModule(this->owner)->Get<const Anope::string &>("registration").equals_ci("mail")) + if (Config->GetModule(this->owner)->Get<const Anope::string>("registration").equals_ci("mail")) Command::OnServHelp(source); } }; @@ -345,7 +345,7 @@ class NSRegister : public Module NSRegister(const Anope::string &modname, const Anope::string &creator) : Module(modname, creator, VENDOR), commandnsregister(this), commandnsconfirm(this), commandnsrsend(this) { - if (Config->GetModule(this)->Get<const Anope::string &>("registration").equals_ci("disable")) + if (Config->GetModule(this)->Get<const Anope::string>("registration").equals_ci("disable")) throw ModuleException("Module " + this->name + " will not load with registration disabled."); } }; @@ -377,11 +377,11 @@ static bool SendRegmail(User *u, const NickAlias *na, const BotInfo *bi) message = Language::Translate(na->nc, Config->GetBlock("mail")->Get<const char *>("registration_message")); subject = subject.replace_all_cs("%n", na->nick); - subject = subject.replace_all_cs("%N", Config->GetBlock("networkinfo")->Get<const Anope::string &>("networkname")); + subject = subject.replace_all_cs("%N", Config->GetBlock("networkinfo")->Get<const Anope::string>("networkname")); subject = subject.replace_all_cs("%c", codebuf); message = message.replace_all_cs("%n", na->nick); - message = message.replace_all_cs("%N", Config->GetBlock("networkinfo")->Get<const Anope::string &>("networkname")); + message = message.replace_all_cs("%N", Config->GetBlock("networkinfo")->Get<const Anope::string>("networkname")); message = message.replace_all_cs("%c", codebuf); return Mail::Send(u, nc, bi, subject, message); diff --git a/modules/commands/ns_resetpass.cpp b/modules/commands/ns_resetpass.cpp index f4516c5a6..62fa0905f 100644 --- a/modules/commands/ns_resetpass.cpp +++ b/modules/commands/ns_resetpass.cpp @@ -143,11 +143,11 @@ static bool SendResetEmail(User *u, const NickAlias *na, const BotInfo *bi) message = Language::Translate(na->nc, Config->GetBlock("mail")->Get<const char *>("reset_message")); subject = subject.replace_all_cs("%n", na->nick); - subject = subject.replace_all_cs("%N", Config->GetBlock("networkinfo")->Get<const Anope::string &>("networkname")); + subject = subject.replace_all_cs("%N", Config->GetBlock("networkinfo")->Get<const Anope::string>("networkname")); subject = subject.replace_all_cs("%c", passcode); message = message.replace_all_cs("%n", na->nick); - message = message.replace_all_cs("%N", Config->GetBlock("networkinfo")->Get<const Anope::string &>("networkname")); + message = message.replace_all_cs("%N", Config->GetBlock("networkinfo")->Get<const Anope::string>("networkname")); message = message.replace_all_cs("%c", passcode); ResetInfo *ri = new ResetInfo; diff --git a/modules/commands/ns_set.cpp b/modules/commands/ns_set.cpp index fdc3aaac6..f0bff477e 100644 --- a/modules/commands/ns_set.cpp +++ b/modules/commands/ns_set.cpp @@ -468,11 +468,11 @@ class CommandNSSetEmail : public Command message = Config->GetBlock("mail")->Get<const char *>("emailchange_message"); subject = subject.replace_all_cs("%e", u->Account()->email); - subject = subject.replace_all_cs("%N", Config->GetBlock("networkinfo")->Get<const Anope::string &>("networkname")); + subject = subject.replace_all_cs("%N", Config->GetBlock("networkinfo")->Get<const Anope::string>("networkname")); subject = subject.replace_all_cs("%c", code); message = message.replace_all_cs("%e", u->Account()->email); - message = message.replace_all_cs("%N", Config->GetBlock("networkinfo")->Get<const Anope::string &>("networkname")); + message = message.replace_all_cs("%N", Config->GetBlock("networkinfo")->Get<const Anope::string>("networkname")); message = message.replace_all_cs("%c", code); return Mail::Send(u, u->Account(), bi, subject, message); diff --git a/modules/commands/ns_set_misc.cpp b/modules/commands/ns_set_misc.cpp index 871a1191f..ae7c2cb53 100644 --- a/modules/commands/ns_set_misc.cpp +++ b/modules/commands/ns_set_misc.cpp @@ -169,13 +169,13 @@ class NSSetMisc : public Module { Configuration::Block *block = conf->GetBlock("command", i); - const Anope::string &cmd = block->Get<const Anope::string &>("command"); + const Anope::string &cmd = block->Get<const Anope::string>("command"); if (cmd != "nickserv/set/misc" && cmd != "nickserv/saset/misc") continue; - Anope::string cname = block->Get<const Anope::string &>("name"); - Anope::string desc = block->Get<const Anope::string &>("misc_description"); + Anope::string cname = block->Get<const Anope::string>("name"); + Anope::string desc = block->Get<const Anope::string>("misc_description"); if (cname.empty() || desc.empty()) continue; diff --git a/modules/commands/os_akill.cpp b/modules/commands/os_akill.cpp index c90dd096f..b7433d0eb 100644 --- a/modules/commands/os_akill.cpp +++ b/modules/commands/os_akill.cpp @@ -121,7 +121,7 @@ class CommandOSAKill : public Command if (mask[0] == '/' && mask[mask.length() - 1] == '/') { - const Anope::string ®exengine = Config->GetBlock("options")->Get<const Anope::string &>("regexengine"); + const Anope::string ®exengine = Config->GetBlock("options")->Get<const Anope::string>("regexengine"); if (regexengine.empty()) { @@ -419,7 +419,7 @@ class CommandOSAKill : public Command "be given, even if it is the same as the default. The\n" "current AKILL default expiry time can be found with the\n" "\002STATS AKILL\002 command.")); - const Anope::string ®exengine = Config->GetBlock("options")->Get<const Anope::string &>("regexengine"); + const Anope::string ®exengine = Config->GetBlock("options")->Get<const Anope::string>("regexengine"); if (!regexengine.empty()) { source.Reply(" "); diff --git a/modules/commands/os_defcon.cpp b/modules/commands/os_defcon.cpp index a75d4691b..6d47d3a9f 100644 --- a/modules/commands/os_defcon.cpp +++ b/modules/commands/os_defcon.cpp @@ -345,26 +345,26 @@ class OSDefcon : public Module DefconConfig dconfig; dconfig.defaultlevel = block->Get<int>("defaultlevel"); - dconfig.defcons[4] = block->Get<const Anope::string &>("level4"); - dconfig.defcons[3] = block->Get<const Anope::string &>("level3"); - dconfig.defcons[2] = block->Get<const Anope::string &>("level2"); - dconfig.defcons[1] = block->Get<const Anope::string &>("level1"); + dconfig.defcons[4] = block->Get<const Anope::string>("level4"); + dconfig.defcons[3] = block->Get<const Anope::string>("level3"); + dconfig.defcons[2] = block->Get<const Anope::string>("level2"); + dconfig.defcons[1] = block->Get<const Anope::string>("level1"); dconfig.sessionlimit = block->Get<int>("sessionlimit"); - dconfig.akillreason = block->Get<const Anope::string &>("akillreason"); + dconfig.akillreason = block->Get<const Anope::string>("akillreason"); dconfig.akillexpire = block->Get<time_t>("akillexpire"); - dconfig.chanmodes = block->Get<const Anope::string &>("chanmodes"); + dconfig.chanmodes = block->Get<const Anope::string>("chanmodes"); dconfig.timeout = block->Get<time_t>("timeout"); dconfig.globalondefcon = block->Get<bool>("globalondefcon"); - dconfig.message = block->Get<const Anope::string &>("message"); - dconfig.offmessage = block->Get<const Anope::string &>("offmessage"); + dconfig.message = block->Get<const Anope::string>("message"); + dconfig.offmessage = block->Get<const Anope::string>("offmessage"); Module *session = ModuleManager::FindModule("os_session"); block = conf->GetModule(session); dconfig.max_session_kill = block->Get<int>("maxsessionkill"); dconfig.session_autokill_expiry = block->Get<time_t>("sessionautokillexpiry"); - dconfig.sle_reason = block->Get<const Anope::string &>("sessionlimitexceeded"); - dconfig.sle_detailsloc = block->Get<const Anope::string &>("sessionlimitdetailsloc"); + dconfig.sle_reason = block->Get<const Anope::string>("sessionlimitexceeded"); + dconfig.sle_detailsloc = block->Get<const Anope::string>("sessionlimitdetailsloc"); if (dconfig.defaultlevel < 1 || dconfig.defaultlevel > 5) throw ConfigException("The value for <defcon:defaultlevel> must be between 1 and 5"); diff --git a/modules/commands/os_forbid.cpp b/modules/commands/os_forbid.cpp index 1d683a7e6..6cc00edda 100644 --- a/modules/commands/os_forbid.cpp +++ b/modules/commands/os_forbid.cpp @@ -230,7 +230,7 @@ class CommandOSForbid : public Command source.Reply(_("Forbid allows you to forbid usage of certain nicknames, channels,\n" "and email addresses. Wildcards are accepted for all entries.")); - const Anope::string ®exengine = Config->GetBlock("options")->Get<const Anope::string &>("regexengine"); + const Anope::string ®exengine = Config->GetBlock("options")->Get<const Anope::string>("regexengine"); if (!regexengine.empty()) { source.Reply(" "); diff --git a/modules/commands/os_ignore.cpp b/modules/commands/os_ignore.cpp index 08aaeaaf3..b7dda73a3 100644 --- a/modules/commands/os_ignore.cpp +++ b/modules/commands/os_ignore.cpp @@ -299,7 +299,7 @@ class CommandOSIgnore : public Command " \n" "Ignores will not be enforced on IRC Operators.")); - const Anope::string ®exengine = Config->GetBlock("options")->Get<const Anope::string &>("regexengine"); + const Anope::string ®exengine = Config->GetBlock("options")->Get<const Anope::string>("regexengine"); if (!regexengine.empty()) { source.Reply(" "); diff --git a/modules/commands/os_list.cpp b/modules/commands/os_list.cpp index 6692f52fd..dc1fd15ed 100644 --- a/modules/commands/os_list.cpp +++ b/modules/commands/os_list.cpp @@ -103,7 +103,7 @@ class CommandOSChanList : public Command "specified, lists only channels matching \002pattern\002 that have the +s or\n" "+p mode.")); - const Anope::string ®exengine = Config->GetBlock("options")->Get<const Anope::string &>("regexengine"); + const Anope::string ®exengine = Config->GetBlock("options")->Get<const Anope::string>("regexengine"); if (!regexengine.empty()) { source.Reply(" "); @@ -209,7 +209,7 @@ class CommandOSUserList : public Command "that are on the given channel. If INVISIBLE is specified, only users\n" "with the +i flag will be listed.")); - const Anope::string ®exengine = Config->GetBlock("options")->Get<const Anope::string &>("regexengine"); + const Anope::string ®exengine = Config->GetBlock("options")->Get<const Anope::string>("regexengine"); if (!regexengine.empty()) { source.Reply(" "); diff --git a/modules/commands/os_logsearch.cpp b/modules/commands/os_logsearch.cpp index 5bc11a6c9..d967da9e8 100644 --- a/modules/commands/os_logsearch.cpp +++ b/modules/commands/os_logsearch.cpp @@ -89,7 +89,7 @@ class CommandOSLogSearch : public Command Log(LOG_ADMIN, source, this) << "for " << search_string; - const Anope::string &logfile_name = Config->GetModule(this->owner)->Get<const Anope::string &>("logname"); + const Anope::string &logfile_name = Config->GetModule(this->owner)->Get<const Anope::string>("logname"); std::list<Anope::string> matches; for (int d = days - 1; d >= 0; --d) { diff --git a/modules/commands/os_session.cpp b/modules/commands/os_session.cpp index 42449e44b..1e0e7c59c 100644 --- a/modules/commands/os_session.cpp +++ b/modules/commands/os_session.cpp @@ -652,8 +652,8 @@ class OSSession : public Module session_limit = block->Get<int>("defaultsessionlimit"); max_session_kill = block->Get<int>("maxsessionkill"); session_autokill_expiry = block->Get<time_t>("sessionautokillexpiry"); - sle_reason = block->Get<const Anope::string &>("sessionlimitexceeded"); - sle_detailsloc = block->Get<const Anope::string &>("sessionlimitdetailsloc"); + sle_reason = block->Get<const Anope::string>("sessionlimitexceeded"); + sle_detailsloc = block->Get<const Anope::string>("sessionlimitdetailsloc"); max_exception_limit = block->Get<int>("maxsessionlimit"); exception_expiry = block->Get<time_t>("exceptionexpiry"); diff --git a/modules/commands/os_sxline.cpp b/modules/commands/os_sxline.cpp index efe81955d..55ba83455 100644 --- a/modules/commands/os_sxline.cpp +++ b/modules/commands/os_sxline.cpp @@ -311,7 +311,7 @@ class CommandOSSNLine : public CommandOSSXLineBase if (mask[0] == '/' && mask[mask.length() - 1] == '/') { - const Anope::string ®exengine = Config->GetBlock("options")->Get<const Anope::string &>("regexengine"); + const Anope::string ®exengine = Config->GetBlock("options")->Get<const Anope::string>("regexengine"); if (regexengine.empty()) { @@ -438,7 +438,7 @@ class CommandOSSNLine : public CommandOSSXLineBase "\002STATS AKILL\002 command.\n" "Note: because the realname mask may contain spaces, the\n" "separator between it and the reason is a colon.")); - const Anope::string ®exengine = Config->GetBlock("options")->Get<const Anope::string &>("regexengine"); + const Anope::string ®exengine = Config->GetBlock("options")->Get<const Anope::string>("regexengine"); if (!regexengine.empty()) { source.Reply(" "); @@ -527,7 +527,7 @@ class CommandOSSQLine : public CommandOSSXLineBase if (mask[0] == '/' && mask[mask.length() - 1] == '/') { - const Anope::string ®exengine = Config->GetBlock("options")->Get<const Anope::string &>("regexengine"); + const Anope::string ®exengine = Config->GetBlock("options")->Get<const Anope::string>("regexengine"); if (regexengine.empty()) { @@ -674,7 +674,7 @@ class CommandOSSQLine : public CommandOSSXLineBase "must be given, even if it is the same as the default. The\n" "current SQLINE default expiry time can be found with the\n" "\002STATS AKILL\002 command.")); - const Anope::string ®exengine = Config->GetBlock("options")->Get<const Anope::string &>("regexengine"); + const Anope::string ®exengine = Config->GetBlock("options")->Get<const Anope::string>("regexengine"); if (!regexengine.empty()) { source.Reply(" "); diff --git a/modules/database/db_flatfile.cpp b/modules/database/db_flatfile.cpp index 8cede5394..f7cc3df59 100644 --- a/modules/database/db_flatfile.cpp +++ b/modules/database/db_flatfile.cpp @@ -119,7 +119,7 @@ class DBFlatFile : public Module, public Pipe const std::vector<Anope::string> &type_order = Serialize::Type::GetTypeOrder(); std::set<Anope::string> dbs; - dbs.insert(Config->GetModule(this)->Get<const Anope::string &>("database")); + dbs.insert(Config->GetModule(this)->Get<const Anope::string>("database")); for (unsigned i = 0; i < type_order.size(); ++i) { @@ -195,7 +195,7 @@ class DBFlatFile : public Module, public Pipe const std::vector<Anope::string> &type_order = Serialize::Type::GetTypeOrder(); std::set<Anope::string> tried_dbs; - const Anope::string &db_name = Anope::DataDir + "/" + Config->GetModule(this)->Get<const Anope::string &>("database"); + const Anope::string &db_name = Anope::DataDir + "/" + Config->GetModule(this)->Get<const Anope::string>("database"); std::fstream fd(db_name.c_str(), std::ios_base::in); if (!fd.is_open()) @@ -272,7 +272,7 @@ class DBFlatFile : public Module, public Pipe if (s_type->GetOwner()) db_name = Anope::DataDir + "/module_" + s_type->GetOwner()->name + ".db"; else - db_name = Anope::DataDir + "/" + Config->GetModule(this)->Get<const Anope::string &>("database"); + db_name = Anope::DataDir + "/" + Config->GetModule(this)->Get<const Anope::string>("database"); if (Anope::IsFile(db_name)) rename(db_name.c_str(), (db_name + ".tmp").c_str()); @@ -304,7 +304,7 @@ class DBFlatFile : public Module, public Pipe for (std::map<Module *, std::fstream *>::iterator it = databases.begin(), it_end = databases.end(); it != it_end; ++it) { std::fstream *f = it->second; - const Anope::string &db_name = Anope::DataDir + "/" + (it->first ? (it->first->name + ".db") : Config->GetModule(this)->Get<const Anope::string &>("database")); + const Anope::string &db_name = Anope::DataDir + "/" + (it->first ? (it->first->name + ".db") : Config->GetModule(this)->Get<const Anope::string>("database")); if (!f->is_open() || !f->good()) { @@ -349,7 +349,7 @@ class DBFlatFile : public Module, public Pipe if (stype->GetOwner()) db_name = Anope::DataDir + "/module_" + stype->GetOwner()->name + ".db"; else - db_name = Anope::DataDir + "/" + Config->GetModule(this)->Get<const Anope::string &>("database"); + db_name = Anope::DataDir + "/" + Config->GetModule(this)->Get<const Anope::string>("database"); std::fstream fd(db_name.c_str(), std::ios_base::in); if (!fd.is_open()) diff --git a/modules/database/db_old.cpp b/modules/database/db_old.cpp index fd499d0cb..64faafe10 100644 --- a/modules/database/db_old.cpp +++ b/modules/database/db_old.cpp @@ -1098,7 +1098,7 @@ class DBOld : public Module Implementation i[] = { I_OnLoadDatabase, I_OnUplinkSync }; ModuleManager::Attach(i, this, sizeof(i) / sizeof(Implementation)); - hashm = Config->GetModule(this)->Get<const Anope::string &>("hash"); + hashm = Config->GetModule(this)->Get<const Anope::string>("hash"); if (hashm != "md5" && hashm != "oldmd5" && hashm != "sha1" && hashm != "plain" && hashm != "sha256") throw ModuleException("Invalid hash method"); diff --git a/modules/database/db_plain.cpp b/modules/database/db_plain.cpp index 3c6324b6f..809fcc2e5 100644 --- a/modules/database/db_plain.cpp +++ b/modules/database/db_plain.cpp @@ -637,7 +637,7 @@ class DBPlain : public Module void OnReload(Configuration::Conf *conf) anope_override { - DatabaseFile = Anope::DataDir + "/" + conf->GetModule(this)->Get<const Anope::string &>("database"); + DatabaseFile = Anope::DataDir + "/" + conf->GetModule(this)->Get<const Anope::string>("database"); if (DatabaseFile.empty()) DatabaseFile = "anope.db"; BackupFile = Anope::DataDir + "/backups/" + DatabaseFile; diff --git a/modules/database/db_sql.cpp b/modules/database/db_sql.cpp index 145857614..bb4d5277b 100644 --- a/modules/database/db_sql.cpp +++ b/modules/database/db_sql.cpp @@ -149,8 +149,8 @@ class DBSQL : public Module, public Pipe void OnReload(Configuration::Conf *conf) anope_override { Configuration::Block *block = conf->GetModule(this); - this->sql = ServiceReference<Provider>("SQL::Provider", block->Get<const Anope::string &>("engine")); - this->prefix = block->Get<const Anope::string &>("prefix", "anope_db_"); + this->sql = ServiceReference<Provider>("SQL::Provider", block->Get<const Anope::string>("engine")); + this->prefix = block->Get<const Anope::string>("prefix", "anope_db_"); this->import = block->Get<bool>("import"); } diff --git a/modules/database/db_sql_live.cpp b/modules/database/db_sql_live.cpp index 091febda7..1a53f98d0 100644 --- a/modules/database/db_sql_live.cpp +++ b/modules/database/db_sql_live.cpp @@ -131,8 +131,8 @@ class DBMySQL : public Module, public Pipe void OnReload(Configuration::Conf *conf) anope_override { Configuration::Block *block = conf->GetModule(this); - this->SQL = ServiceReference<Provider>("SQL::Provider", block->Get<const Anope::string &>("engine")); - this->prefix = block->Get<const Anope::string &>("prefix", "anope_db_"); + this->SQL = ServiceReference<Provider>("SQL::Provider", block->Get<const Anope::string>("engine")); + this->prefix = block->Get<const Anope::string>("prefix", "anope_db_"); } void OnSerializableConstruct(Serializable *obj) anope_override diff --git a/modules/extra/m_chanstats.cpp b/modules/extra/m_chanstats.cpp index f5e20646b..65e71a5c0 100644 --- a/modules/extra/m_chanstats.cpp +++ b/modules/extra/m_chanstats.cpp @@ -352,12 +352,12 @@ class MChanstats : public Module void OnReload(Configuration::Conf *conf) anope_override { Configuration::Block *block = conf->GetModule(this); - prefix = block->Get<const Anope::string &>("prefix", "anope_"); - SmileysHappy = block->Get<const Anope::string &>("SmileysHappy"); - SmileysSad = block->Get<const Anope::string &>("SmileysSad"); - SmileysOther = block->Get<const Anope::string &>("SmileysOther"); + prefix = block->Get<const Anope::string>("prefix", "anope_"); + SmileysHappy = block->Get<const Anope::string>("SmileysHappy"); + SmileysSad = block->Get<const Anope::string>("SmileysSad"); + SmileysOther = block->Get<const Anope::string>("SmileysOther"); - Anope::string engine = block->Get<const Anope::string &>("engine"); + Anope::string engine = block->Get<const Anope::string>("engine"); this->sql = ServiceReference<SQL::Provider>("SQL::Provider", engine); if (sql) this->CheckTables(); diff --git a/modules/extra/m_httpd.cpp b/modules/extra/m_httpd.cpp index 87d1ad6a1..1941985d1 100644 --- a/modules/extra/m_httpd.cpp +++ b/modules/extra/m_httpd.cpp @@ -361,15 +361,15 @@ class HTTPD : public Module Configuration::Block *block = conf->GetBlock("httpd", i); - const Anope::string &hname = block->Get<const Anope::string &>("name", "httpd/main"); + const Anope::string &hname = block->Get<const Anope::string>("name", "httpd/main"); existing.insert(hname); - Anope::string ip = block->Get<const Anope::string &>("ip"); + Anope::string ip = block->Get<const Anope::string>("ip"); int port = block->Get<int>("port", "8080"); int timeout = block->Get<int>("timeout", "30"); bool ssl = block->Get<bool>("ssl", "no"); - Anope::string ext_ip = block->Get<const Anope::string &>("extforward_ip"); - Anope::string ext_header = block->Get<const Anope::string &>("extforward_header"); + Anope::string ext_ip = block->Get<const Anope::string>("extforward_ip"); + Anope::string ext_header = block->Get<const Anope::string>("extforward_header"); if (ip.empty()) { diff --git a/modules/extra/m_ldap.cpp b/modules/extra/m_ldap.cpp index a6066c008..7ded21d6f 100644 --- a/modules/extra/m_ldap.cpp +++ b/modules/extra/m_ldap.cpp @@ -434,7 +434,7 @@ class ModuleLDAP : public Module, public Pipe ++it; for (i = 0; i < Config->CountBlock("ldap"); ++i) - if (Config->GetBlock("ldap", i)->Get<const Anope::string &>("name", "ldap/main") == cname) + if (Config->GetBlock("ldap", i)->Get<const Anope::string>("name", "ldap/main") == cname) break; if (i == num) @@ -449,14 +449,14 @@ class ModuleLDAP : public Module, public Pipe for (i = 0; i < Config->CountBlock("ldap"); ++i) { - const Anope::string &connname = Config->GetBlock("ldap", i)->Get<const Anope::string &>("name", "ldap/main"); + const Anope::string &connname = Config->GetBlock("ldap", i)->Get<const Anope::string>("name", "ldap/main"); if (this->LDAPServices.find(connname) == this->LDAPServices.end()) { - const Anope::string &server = Config->GetBlock("ldap", i)->Get<const Anope::string &>("server", "127.0.0.1"); + const Anope::string &server = Config->GetBlock("ldap", i)->Get<const Anope::string>("server", "127.0.0.1"); int port = Config->GetBlock("ldap", i)->Get<int>("port", "389"); - const Anope::string &admin_binddn = Config->GetBlock("ldap", i)->Get<const Anope::string &>("admin_binddn"); - const Anope::string &admin_password = Config->GetBlock("ldap", i)->Get<const Anope::string &>("admin_password"); + const Anope::string &admin_binddn = Config->GetBlock("ldap", i)->Get<const Anope::string>("admin_binddn"); + const Anope::string &admin_password = Config->GetBlock("ldap", i)->Get<const Anope::string>("admin_password"); try { diff --git a/modules/extra/m_ldap_authentication.cpp b/modules/extra/m_ldap_authentication.cpp index a8ece73ff..8238082a5 100644 --- a/modules/extra/m_ldap_authentication.cpp +++ b/modules/extra/m_ldap_authentication.cpp @@ -225,14 +225,14 @@ class NSIdentifyLDAP : public Module { Configuration::Block *config = Config->GetModule(this); - basedn = conf->Get<const Anope::string &>("basedn"); - search_filter = conf->Get<const Anope::string &>("search_filter"); - object_class = conf->Get<const Anope::string &>("object_class"); - username_attribute = conf->Get<const Anope::string &>("username_attribute"); - this->password_attribute = conf->Get<const Anope::string &>("password_attribute"); - email_attribute = conf->Get<const Anope::string &>("email_attribute"); - this->disable_register_reason = conf->Get<const Anope::string &>("disable_register_reason"); - this->disable_email_reason = conf->Get<const Anope::string &>("disable_email_reason"); + basedn = conf->Get<const Anope::string>("basedn"); + search_filter = conf->Get<const Anope::string>("search_filter"); + object_class = conf->Get<const Anope::string>("object_class"); + username_attribute = conf->Get<const Anope::string>("username_attribute"); + this->password_attribute = conf->Get<const Anope::string>("password_attribute"); + email_attribute = conf->Get<const Anope::string>("email_attribute"); + this->disable_register_reason = conf->Get<const Anope::string>("disable_register_reason"); + this->disable_email_reason = conf->Get<const Anope::string>("disable_email_reason"); if (!email_attribute.empty()) /* Don't complain to users about how they need to update their email, we will do it for them */ diff --git a/modules/extra/m_ldap_oper.cpp b/modules/extra/m_ldap_oper.cpp index 4324a7bc0..a54556c80 100644 --- a/modules/extra/m_ldap_oper.cpp +++ b/modules/extra/m_ldap_oper.cpp @@ -97,11 +97,11 @@ class LDAPOper : public Module { Configuration::Block *config = Config->GetModule(this); - this->binddn = config->Get<const Anope::string &>("binddn"); - this->password = config->Get<const Anope::string &>("password"); - this->basedn = config->Get<const Anope::string &>("basedn"); - this->filter = config->Get<const Anope::string &>("filter"); - opertype_attribute = config->Get<const Anope::string &>("opertype_attribute"); + this->binddn = config->Get<const Anope::string>("binddn"); + this->password = config->Get<const Anope::string>("password"); + this->basedn = config->Get<const Anope::string>("basedn"); + this->filter = config->Get<const Anope::string>("filter"); + opertype_attribute = config->Get<const Anope::string>("opertype_attribute"); for (std::set<Oper *>::iterator it = my_opers.begin(), it_end = my_opers.end(); it != it_end; ++it) delete *it; diff --git a/modules/extra/m_mysql.cpp b/modules/extra/m_mysql.cpp index 372cb6982..b8270b91f 100644 --- a/modules/extra/m_mysql.cpp +++ b/modules/extra/m_mysql.cpp @@ -200,7 +200,7 @@ class ModuleSQL : public Module, public Pipe ++it; for (i = 0; i < Config->CountBlock("mysql"); ++i) - if (Config->GetBlock("mysql", i)->Get<const Anope::string &>("name", "main") == cname) + if (Config->GetBlock("mysql", i)->Get<const Anope::string>("name", "main") == cname) break; if (i == num) @@ -215,14 +215,14 @@ class ModuleSQL : public Module, public Pipe for (i = 0; i < Config->CountBlock("mysql"); ++i) { Configuration::Block *block = Config->GetBlock("mysql", i); - const Anope::string &connname = block->Get<const Anope::string &>("name", "mysql/main"); + const Anope::string &connname = block->Get<const Anope::string>("name", "mysql/main"); if (this->MySQLServices.find(connname) == this->MySQLServices.end()) { - const Anope::string &database = block->Get<const Anope::string &>("database", "anope"); - const Anope::string &server = block->Get<const Anope::string &>("server", "127.0.0.1"); - const Anope::string &user = block->Get<const Anope::string &>("username", "anope"); - const Anope::string &password = block->Get<const Anope::string &>("password"); + const Anope::string &database = block->Get<const Anope::string>("database", "anope"); + const Anope::string &server = block->Get<const Anope::string>("server", "127.0.0.1"); + const Anope::string &user = block->Get<const Anope::string>("username", "anope"); + const Anope::string &password = block->Get<const Anope::string>("password"); int port = block->Get<int>("port", "3306"); try diff --git a/modules/extra/m_proxyscan.cpp b/modules/extra/m_proxyscan.cpp index c77f0f9cd..075f9067e 100644 --- a/modules/extra/m_proxyscan.cpp +++ b/modules/extra/m_proxyscan.cpp @@ -257,7 +257,7 @@ class ModuleProxyScan : public Module { Configuration::Block *config = Config->GetModule(this); - Anope::string s_target_ip = config->Get<const Anope::string &>("target_ip"); + Anope::string s_target_ip = config->Get<const Anope::string>("target_ip"); if (s_target_ip.empty()) throw ConfigException(this->name + " target_ip may not be empty"); @@ -265,7 +265,7 @@ class ModuleProxyScan : public Module if (s_target_port <= 0) throw ConfigException(this->name + " target_port may not be empty and must be a positive number"); - Anope::string s_listen_ip = config->Get<const Anope::string &>("listen_ip"); + Anope::string s_listen_ip = config->Get<const Anope::string>("listen_ip"); if (s_listen_ip.empty()) throw ConfigException(this->name + " listen_ip may not be empty"); @@ -277,12 +277,12 @@ class ModuleProxyScan : public Module target_port = s_target_port; this->listen_ip = s_listen_ip; this->listen_port = s_listen_port; - this->con_notice = config->Get<const Anope::string &>("connect_notice"); - this->con_source = config->Get<const Anope::string &>("connect_source"); + this->con_notice = config->Get<const Anope::string>("connect_notice"); + this->con_source = config->Get<const Anope::string>("connect_source"); add_to_akill = config->Get<bool>("add_to_akill", "true"); this->connectionTimeout.SetSecs(config->Get<time_t>("timeout", "5s")); - ProxyCheckString = Config->GetBlock("networkinfo")->Get<const Anope::string &>("networkname") + " proxy check"; + ProxyCheckString = Config->GetBlock("networkinfo")->Get<const Anope::string>("networkname") + " proxy check"; delete this->listener; this->listener = NULL; try @@ -301,7 +301,7 @@ class ModuleProxyScan : public Module ProxyCheck p; Anope::string token; - commasepstream sep(block->Get<const Anope::string &>("type")); + commasepstream sep(block->Get<const Anope::string>("type")); while (sep.GetToken(token)) { if (!token.equals_ci("HTTP") && !token.equals_ci("SOCKS5")) @@ -311,7 +311,7 @@ class ModuleProxyScan : public Module if (p.types.empty()) continue; - commasepstream sep2(block->Get<const Anope::string &>("port")); + commasepstream sep2(block->Get<const Anope::string>("port")); while (sep2.GetToken(token)) { try @@ -325,7 +325,7 @@ class ModuleProxyScan : public Module continue; p.duration = block->Get<time_t>("time", "4h"); - p.reason = block->Get<const Anope::string &>("reason"); + p.reason = block->Get<const Anope::string>("reason"); if (p.reason.empty()) continue; diff --git a/modules/extra/m_sql_authentication.cpp b/modules/extra/m_sql_authentication.cpp index 98fd4c2e9..693f06b33 100644 --- a/modules/extra/m_sql_authentication.cpp +++ b/modules/extra/m_sql_authentication.cpp @@ -85,9 +85,9 @@ class ModuleSQLAuthentication : public Module void OnReload(Configuration::Conf *conf) anope_override { Configuration::Block *config = conf->GetModule(this); - this->engine = config->Get<const Anope::string &>("engine"); - this->query = config->Get<const Anope::string &>("query"); - this->disable_reason = config->Get<const Anope::string &>("disable_reason"); + this->engine = config->Get<const Anope::string>("engine"); + this->query = config->Get<const Anope::string>("query"); + this->disable_reason = config->Get<const Anope::string>("disable_reason"); this->SQL = ServiceReference<SQL::Provider>("SQL::Provider", this->engine); } diff --git a/modules/extra/m_sql_oper.cpp b/modules/extra/m_sql_oper.cpp index 480bcf5a0..a45001835 100644 --- a/modules/extra/m_sql_oper.cpp +++ b/modules/extra/m_sql_oper.cpp @@ -105,8 +105,8 @@ class ModuleSQLOper : public Module { Configuration::Block *config = conf->GetModule(this); - this->engine = config->Get<const Anope::string &>("engine"); - this->query = config->Get<const Anope::string &>("query"); + this->engine = config->Get<const Anope::string>("engine"); + this->query = config->Get<const Anope::string>("query"); this->SQL = ServiceReference<SQL::Provider>("SQL::Provider", this->engine); } diff --git a/modules/extra/m_sqlite.cpp b/modules/extra/m_sqlite.cpp index b0f947985..91bdd4e64 100644 --- a/modules/extra/m_sqlite.cpp +++ b/modules/extra/m_sqlite.cpp @@ -89,7 +89,7 @@ class ModuleSQLite : public Module ++it; for (i = 0, num = config->CountBlock("sqlite"); i < num; ++i) - if (config->GetBlock("sqlite", i)->Get<const Anope::string &>("name", "sqlite/main") == cname) + if (config->GetBlock("sqlite", i)->Get<const Anope::string>("name", "sqlite/main") == cname) break; if (i == num) @@ -104,11 +104,11 @@ class ModuleSQLite : public Module for (int i = 0; i < config->CountBlock("sqlite"); ++i) { Configuration::Block *block = config->GetBlock("sqlite", i); - Anope::string connname = block->Get<const Anope::string &>("name", "sqlite/main"); + Anope::string connname = block->Get<const Anope::string>("name", "sqlite/main"); if (this->SQLiteServices.find(connname) == this->SQLiteServices.end()) { - Anope::string database = Anope::DataDir + "/" + block->Get<const Anope::string &>("database", "anope"); + Anope::string database = Anope::DataDir + "/" + block->Get<const Anope::string>("database", "anope"); try { diff --git a/modules/extra/m_ssl.cpp b/modules/extra/m_ssl.cpp index 3219830e7..bc29b783f 100644 --- a/modules/extra/m_ssl.cpp +++ b/modules/extra/m_ssl.cpp @@ -140,8 +140,8 @@ class SSLModule : public Module { Configuration::Block *config = conf->GetModule(this); - this->certfile = config->Get<const Anope::string &>("cert", "data/anope.crt"); - this->keyfile = config->Get<const Anope::string &>("key", "data/anope.key"); + this->certfile = config->Get<const Anope::string>("cert", "data/anope.crt"); + this->keyfile = config->Get<const Anope::string>("key", "data/anope.key"); if (Anope::IsFile(this->certfile.c_str())) { diff --git a/modules/extra/webcpanel/webcpanel.cpp b/modules/extra/webcpanel/webcpanel.cpp index ca0b2f93d..88606cf67 100644 --- a/modules/extra/webcpanel/webcpanel.cpp +++ b/modules/extra/webcpanel/webcpanel.cpp @@ -53,10 +53,10 @@ class ModuleWebCPanel : public Module me = this; Configuration::Block *block = Config->GetModule(this); - provider_name = block->Get<const Anope::string &>("server", "httpd/main"); - template_name = block->Get<const Anope::string &>("template", "default"); + provider_name = block->Get<const Anope::string>("server", "httpd/main"); + template_name = block->Get<const Anope::string>("template", "default"); template_base = Anope::DataDir + "/modules/webcpanel/templates/" + template_name; - page_title = block->Get<const Anope::string &>("title", "Anope IRC Services"); + page_title = block->Get<const Anope::string>("title", "Anope IRC Services"); use_ssl = block->Get<bool>("ssl", "no"); // This is dumb, is there a better way to do this? ServiceReference<HTTPProvider> provider("HTTPProvider", provider_name); diff --git a/modules/m_dns.cpp b/modules/m_dns.cpp index 4dc419d7c..9b0157069 100644 --- a/modules/m_dns.cpp +++ b/modules/m_dns.cpp @@ -938,12 +938,12 @@ class ModuleDNS : public Module { Configuration::Block *block = conf->GetModule(this); - nameserver = block->Get<const Anope::string &>("nameserver", "127.0.0.1"); + nameserver = block->Get<const Anope::string>("nameserver", "127.0.0.1"); timeout = block->Get<time_t>("timeout", "5"); - ip = block->Get<const Anope::string &>("ip", "0.0.0.0"); + ip = block->Get<const Anope::string>("ip", "0.0.0.0"); port = block->Get<int>("port", "53"); - admin = block->Get<const Anope::string &>("admin", "admin@example.com"); - nameservers = block->Get<const Anope::string &>("nameservers", "ns1.example.com"); + admin = block->Get<const Anope::string>("admin", "admin@example.com"); + nameservers = block->Get<const Anope::string>("nameservers", "ns1.example.com"); refresh = block->Get<int>("refresh", "3600"); if (Anope::IsFile(nameserver)) diff --git a/modules/m_dnsbl.cpp b/modules/m_dnsbl.cpp index 9e30c49ce..b6ebcfb55 100644 --- a/modules/m_dnsbl.cpp +++ b/modules/m_dnsbl.cpp @@ -63,7 +63,7 @@ class DNSBLResolver : public Request reason = reason.replace_all_cs("%h", user->host); reason = reason.replace_all_cs("%i", user->ip); reason = reason.replace_all_cs("%r", record_reason); - reason = reason.replace_all_cs("%N", Config->GetBlock("networkinfo")->Get<const Anope::string &>("networkname")); + reason = reason.replace_all_cs("%N", Config->GetBlock("networkinfo")->Get<const Anope::string>("networkname")); Log(OperServ) << "DNSBL: " << user->GetMask() << " (" << user->ip << ") appears in " << this->blacklist.name; XLine *x = new XLine("*@" + user->ip, OperServ ? OperServ->nick : "m_dnsbl", Anope::CurTime + this->blacklist.bantime, reason, XLineManager::GenerateUID()); @@ -107,15 +107,15 @@ class ModuleDNSBL : public Module { Configuration::Block *bl = conf->GetBlock("blacklist", i); - Anope::string bname = bl->Get<const Anope::string &>("name"); + Anope::string bname = bl->Get<const Anope::string>("name"); if (bname.empty()) continue; time_t bantime = bl->Get<time_t>("time", "4h"); - Anope::string reason = bl->Get<const Anope::string &>("reason"); + Anope::string reason = bl->Get<const Anope::string>("reason"); std::map<int, Anope::string> replies; for (int j = 0; j < 256; ++j) { - Anope::string k = bl->Get<const Anope::string &>(stringify(j)); + Anope::string k = bl->Get<const Anope::string>(stringify(j)); if (!k.empty()) replies[j] = k; } diff --git a/modules/m_helpchan.cpp b/modules/m_helpchan.cpp index 4768fec71..eaf6eb777 100644 --- a/modules/m_helpchan.cpp +++ b/modules/m_helpchan.cpp @@ -18,7 +18,7 @@ class HelpChannel : public Module EventReturn OnChannelModeSet(Channel *c, MessageSource &setter, const Anope::string &mname, const Anope::string ¶m) anope_override { - if (mname == "OP" && c && c->ci && c->name.equals_ci(Config->GetModule(this)->Get<const Anope::string &>("helpchannel"))) + if (mname == "OP" && c && c->ci && c->name.equals_ci(Config->GetModule(this)->Get<const Anope::string>("helpchannel"))) { User *u = User::Find(param); diff --git a/modules/m_rewrite.cpp b/modules/m_rewrite.cpp index dfa8a9162..8131a1729 100644 --- a/modules/m_rewrite.cpp +++ b/modules/m_rewrite.cpp @@ -172,10 +172,10 @@ class ModuleRewrite : public Module Rewrite rw; - rw.client = block->Get<const Anope::string &>("service"); - rw.source_message = block->Get<const Anope::string &>("rewrite_source"); - rw.target_message = block->Get<const Anope::string &>("rewrite_target"); - rw.desc = block->Get<const Anope::string &>("rewrite_description"); + rw.client = block->Get<const Anope::string>("service"); + rw.source_message = block->Get<const Anope::string>("rewrite_source"); + rw.target_message = block->Get<const Anope::string>("rewrite_target"); + rw.desc = block->Get<const Anope::string>("rewrite_description"); if (rw.client.empty() || rw.source_message.empty() || rw.target_message.empty()) continue; diff --git a/modules/protocol/inspircd20.cpp b/modules/protocol/inspircd20.cpp index 3884862d9..3ebb79d3a 100644 --- a/modules/protocol/inspircd20.cpp +++ b/modules/protocol/inspircd20.cpp @@ -368,7 +368,7 @@ struct IRCDMessageCapab : Message::Capab else if (module.find("m_rline.so") == 0) { Servers::Capab.insert("RLINE"); - const Anope::string ®exengine = Config->GetBlock("options")->Get<const Anope::string &>("regexengine"); + const Anope::string ®exengine = Config->GetBlock("options")->Get<const Anope::string>("regexengine"); if (!regexengine.empty() && module.length() > 11 && regexengine != module.substr(11)) Log() << "Warning: InspIRCd is using regex engine " << module.substr(11) << ", but we have " << regexengine << ". This may cause inconsistencies."; } diff --git a/modules/pseudoclients/botserv.cpp b/modules/pseudoclients/botserv.cpp index c33a8eeb5..bae03eb7e 100644 --- a/modules/pseudoclients/botserv.cpp +++ b/modules/pseudoclients/botserv.cpp @@ -30,7 +30,7 @@ class BotServCore : public Module void OnReload(Configuration::Conf *conf) anope_override { - const Anope::string &bsnick = conf->GetModule(this)->Get<const Anope::string &>("client"); + const Anope::string &bsnick = conf->GetModule(this)->Get<const Anope::string>("client"); if (bsnick.empty()) throw ConfigException(this->name + ": <client> must be defined"); @@ -47,7 +47,7 @@ class BotServCore : public Module /* Do not allow removing bot modes on our service bots */ if (chan->ci && chan->ci->bi == user) { - const Anope::string &botmodes = Config->GetModule(this)->Get<const Anope::string &>("botmodes"); + const Anope::string &botmodes = Config->GetModule(this)->Get<const Anope::string>("botmodes"); for (unsigned i = 0; i < botmodes.length(); ++i) chan->SetMode(chan->ci->bi, ModeManager::FindChannelModeByChar(botmodes[i]), chan->ci->bi->GetUID()); } @@ -57,7 +57,7 @@ class BotServCore : public Module { if (Me->IsSynced() && ci->c && ci->c->users.size() >= Config->GetModule(this)->Get<unsigned>("minusers")) { - ChannelStatus status(Config->GetModule(this)->Get<const Anope::string &>("botmodes")); + ChannelStatus status(Config->GetModule(this)->Get<const Anope::string>("botmodes")); bi->Join(ci->c, &status); } } @@ -99,7 +99,7 @@ class BotServCore : public Module if (!realbuf.find(c->ci->bi->nick)) params.erase(params.begin()); - else if (!realbuf.find_first_of(Config->GetModule(this)->Get<const Anope::string &>("fantasycharacter", "!"))) + else if (!realbuf.find_first_of(Config->GetModule(this)->Get<const Anope::string>("fantasycharacter", "!"))) params[0].erase(params[0].begin()); else return; @@ -231,7 +231,7 @@ class BotServCore : public Module **/ if (c->users.size() >= Config->GetModule(this)->Get<unsigned>("minusers") && !c->FindUser(c->ci->bi)) { - ChannelStatus status(Config->GetModule(this)->Get<const Anope::string &>("botmodes")); + ChannelStatus status(Config->GetModule(this)->Get<const Anope::string>("botmodes")); c->ci->bi->Join(c, &status); } /* Only display the greet if the main uplink we're connected @@ -279,7 +279,7 @@ class BotServCore : public Module "channel, and provide a more convenient way to execute commands. Commands that\n" "require a channel as a parameter will automatically have that parameter\n" "given.\n"), source.service->nick.c_str()); - const Anope::string &fantasycharacters = Config->GetModule(this)->Get<const Anope::string &>("fantasycharacter", "!"); + const Anope::string &fantasycharacters = Config->GetModule(this)->Get<const Anope::string>("fantasycharacter", "!"); if (!fantasycharacters.empty()) source.Reply(_(" \n" "Fantasy commands may be prefixed with one of the following characters: %s\n"), fantasycharacters.c_str()); @@ -310,7 +310,7 @@ class BotServCore : public Module source.Reply(_(" \n" "Bot will join a channel whenever there is at least\n" "\002%d\002 user(s) on it."), Config->GetModule(this)->Get<unsigned>("minusers")); - const Anope::string &fantasycharacters = Config->GetModule(this)->Get<const Anope::string &>("fantasycharacter", "!"); + const Anope::string &fantasycharacters = Config->GetModule(this)->Get<const Anope::string>("fantasycharacter", "!"); if (!fantasycharacters.empty()) source.Reply(_("Additionally, if fantasy is enabled fantasy commands\n" "can be executed by prefixing the command name with\n" @@ -334,7 +334,7 @@ class BotServCore : public Module void OnCreateChan(ChannelInfo *ci) anope_override { /* Set default bot flags */ - spacesepstream sep(Config->GetModule(this)->Get<const Anope::string &>("defaults", "greet fantasy")); + spacesepstream sep(Config->GetModule(this)->Get<const Anope::string>("defaults", "greet fantasy")); for (Anope::string token; sep.GetToken(token);) this->ExtendMetadata("BS_" + token); } diff --git a/modules/pseudoclients/chanserv.cpp b/modules/pseudoclients/chanserv.cpp index e34cd56e8..a93271581 100644 --- a/modules/pseudoclients/chanserv.cpp +++ b/modules/pseudoclients/chanserv.cpp @@ -149,7 +149,7 @@ class ChanServCore : public Module void OnReload(Configuration::Conf *conf) anope_override { - const Anope::string &channick = conf->GetModule(this)->Get<const Anope::string &>("client"); + const Anope::string &channick = conf->GetModule(this)->Get<const Anope::string>("client"); if (channick.empty()) throw ConfigException(this->name + ": <client> must be defined"); @@ -160,7 +160,7 @@ class ChanServCore : public Module ChanServ = bi; - spacesepstream(conf->GetModule(this)->Get<const Anope::string &>("defaults", "greet fantasy")).GetTokens(defaults); + spacesepstream(conf->GetModule(this)->Get<const Anope::string>("defaults", "greet fantasy")).GetTokens(defaults); if (defaults.empty()) { defaults.push_back("KEEPTOPIC"); @@ -297,7 +297,7 @@ class ChanServCore : public Module EventReturn OnCheckModes(Channel *c) anope_override { - const Anope::string &require = Config->GetModule(this)->Get<const Anope::string &>("require", "r"); + const Anope::string &require = Config->GetModule(this)->Get<const Anope::string>("require", "r"); if (!require.empty()) { if (c->ci) @@ -319,7 +319,7 @@ class ChanServCore : public Module { Anope::string modes; - spacesepstream sep(Config->GetModule(this)->Get<const Anope::string &>("mlock", "+nrt")); + spacesepstream sep(Config->GetModule(this)->Get<const Anope::string>("mlock", "+nrt")); if (sep.GetToken(modes)) { bool add = true; @@ -343,8 +343,8 @@ class ChanServCore : public Module EventReturn OnCanSet(User *u, const ChannelMode *cm) anope_override { - if (Config->GetModule(this)->Get<const Anope::string &>("nomlock").find(cm->mchar) != Anope::string::npos - || Config->GetModule(this)->Get<const Anope::string &>("require", "r").find(cm->mchar) || Anope::string::npos) + if (Config->GetModule(this)->Get<const Anope::string>("nomlock").find(cm->mchar) != Anope::string::npos + || Config->GetModule(this)->Get<const Anope::string>("require", "r").find(cm->mchar) || Anope::string::npos) return EVENT_STOP; return EVENT_CONTINUE; } diff --git a/modules/pseudoclients/global.cpp b/modules/pseudoclients/global.cpp index 501b02194..67cb594c5 100644 --- a/modules/pseudoclients/global.cpp +++ b/modules/pseudoclients/global.cpp @@ -61,7 +61,7 @@ class GlobalCore : public Module void OnReload(Configuration::Conf *conf) anope_override { - const Anope::string &glnick = conf->GetModule(this)->Get<const Anope::string &>("client"); + const Anope::string &glnick = conf->GetModule(this)->Get<const Anope::string>("client"); if (glnick.empty()) throw ConfigException(this->name + ": <client> must be defined"); @@ -81,21 +81,21 @@ class GlobalCore : public Module void OnRestart() anope_override { - const Anope::string &gl = Config->GetModule(this)->Get<const Anope::string &>("globaloncycledown"); + const Anope::string &gl = Config->GetModule(this)->Get<const Anope::string>("globaloncycledown"); if (!gl.empty()) this->global.SendGlobal(Global, "", gl); } void OnShutdown() anope_override { - const Anope::string &gl = Config->GetModule(this)->Get<const Anope::string &>("globaloncycledown"); + const Anope::string &gl = Config->GetModule(this)->Get<const Anope::string>("globaloncycledown"); if (!gl.empty()) this->global.SendGlobal(Global, "", gl); } void OnNewServer(Server *s) anope_override { - const Anope::string &gl = Config->GetModule(this)->Get<const Anope::string &>("globaloncycleup"); + const Anope::string &gl = Config->GetModule(this)->Get<const Anope::string>("globaloncycleup"); if (!gl.empty() && !Me->IsSynced()) s->Notice(Global, gl); } diff --git a/modules/pseudoclients/hostserv.cpp b/modules/pseudoclients/hostserv.cpp index acca6f7ff..cd3c84d55 100644 --- a/modules/pseudoclients/hostserv.cpp +++ b/modules/pseudoclients/hostserv.cpp @@ -33,7 +33,7 @@ class HostServCore : public Module void OnReload(Configuration::Conf *conf) anope_override { - const Anope::string &hsnick = conf->GetModule(this)->Get<const Anope::string &>("client"); + const Anope::string &hsnick = conf->GetModule(this)->Get<const Anope::string>("client"); if (hsnick.empty()) throw ConfigException(this->name + ": <client> must be defined"); diff --git a/modules/pseudoclients/memoserv.cpp b/modules/pseudoclients/memoserv.cpp index 499722686..13a34137c 100644 --- a/modules/pseudoclients/memoserv.cpp +++ b/modules/pseudoclients/memoserv.cpp @@ -22,13 +22,13 @@ static bool SendMemoMail(NickCore *nc, MemoInfo *mi, Memo *m) subject = subject.replace_all_cs("%s", m->sender); subject = subject.replace_all_cs("%d", stringify(mi->GetIndex(m) + 1)); subject = subject.replace_all_cs("%t", m->text); - subject = subject.replace_all_cs("%N", Config->GetBlock("networkinfo")->Get<const Anope::string &>("networkname")); + subject = subject.replace_all_cs("%N", Config->GetBlock("networkinfo")->Get<const Anope::string>("networkname")); message = message.replace_all_cs("%n", nc->display); message = message.replace_all_cs("%s", m->sender); message = message.replace_all_cs("%d", stringify(mi->GetIndex(m) + 1)); message = message.replace_all_cs("%t", m->text); - message = message.replace_all_cs("%N", Config->GetBlock("networkinfo")->Get<const Anope::string &>("networkname")); + message = message.replace_all_cs("%N", Config->GetBlock("networkinfo")->Get<const Anope::string>("networkname")); return Mail::Send(nc, subject, message); } @@ -154,7 +154,7 @@ class MemoServCore : public Module void OnReload(Configuration::Conf *conf) anope_override { - const Anope::string &msnick = conf->GetModule(this)->Get<const Anope::string &>("client"); + const Anope::string &msnick = conf->GetModule(this)->Get<const Anope::string>("client"); if (msnick.empty()) throw ConfigException(this->name + ": <client> must be defined"); diff --git a/modules/pseudoclients/nickserv.cpp b/modules/pseudoclients/nickserv.cpp index 1177f9327..e45ad6abf 100644 --- a/modules/pseudoclients/nickserv.cpp +++ b/modules/pseudoclients/nickserv.cpp @@ -209,7 +209,7 @@ class NickServCore : public Module void OnReload(Configuration::Conf *conf) anope_override { - const Anope::string &nsnick = conf->GetModule(this)->Get<const Anope::string &>("client"); + const Anope::string &nsnick = conf->GetModule(this)->Get<const Anope::string>("client"); if (nsnick.empty()) throw ConfigException(this->name + ": <client> must be defined"); @@ -220,7 +220,7 @@ class NickServCore : public Module NickServ = bi; - spacesepstream(conf->GetModule(this)->Get<const Anope::string &>("defaults", "secure memo_signon memo_receive")).GetTokens(defaults); + spacesepstream(conf->GetModule(this)->Get<const Anope::string>("defaults", "secure memo_signon memo_receive")).GetTokens(defaults); if (defaults.empty()) { defaults.push_back("SECURE"); @@ -287,7 +287,7 @@ class NickServCore : public Module c->SetCorrectModes(u, true, true); } - const Anope::string &modesonid = block->Get<const Anope::string &>("modesonid"); + const Anope::string &modesonid = block->Get<const Anope::string>("modesonid"); if (!modesonid.empty()) u->SetModes(NickServ, "%s", modesonid.c_str()); @@ -335,7 +335,7 @@ class NickServCore : public Module return; const NickAlias *na = NickAlias::Find(u->nick); - const Anope::string &unregistered_notice = Config->GetModule(this)->Get<const Anope::string &>("unregistered_notice"); + const Anope::string &unregistered_notice = Config->GetModule(this)->Get<const Anope::string>("unregistered_notice"); if (!Config->GetBlock("options")->Get<bool>("nonicknameownership") && !unregistered_notice.empty() && !na) u->SendMessage(NickServ, unregistered_notice); else if (na) diff --git a/modules/pseudoclients/operserv.cpp b/modules/pseudoclients/operserv.cpp index a3a384cea..0720110cb 100644 --- a/modules/pseudoclients/operserv.cpp +++ b/modules/pseudoclients/operserv.cpp @@ -185,7 +185,7 @@ class OperServCore : public Module void OnReload(Configuration::Conf *conf) anope_override { - const Anope::string &osnick = conf->GetModule(this)->Get<const Anope::string &>("client"); + const Anope::string &osnick = conf->GetModule(this)->Get<const Anope::string>("client"); if (osnick.empty()) throw ConfigException(this->name + ": <client> must be defined"); diff --git a/src/config.cpp b/src/config.cpp index f937b7930..eac2be8c6 100644 --- a/src/config.cpp +++ b/src/config.cpp @@ -77,37 +77,31 @@ const Block::item_map* Block::GetItems() const return NULL; } -template<> const Anope::string& Block::Get(const Anope::string &tag, const Anope::string& def) const +template<> const Anope::string Block::Get(const Anope::string &tag, const Anope::string& def) const { - static Anope::string ret; - if (!this) - { - ret = def; - return ret; - } + return def; Anope::map<Anope::string>::const_iterator it = items.find(tag); if (it != items.end()) return it->second; - ret = def; - return ret; + return def; } template<> time_t Block::Get(const Anope::string &tag, const Anope::string &def) const { - return Anope::DoTime(Get<const Anope::string &>(tag, def)); + return Anope::DoTime(Get<const Anope::string>(tag, def)); } template<> const char* Block::Get(const Anope::string &tag, const Anope::string &def) const { - return this->Get<const Anope::string &>(tag, def).c_str(); + return this->Get<const Anope::string>(tag, def).c_str(); } template<> bool Block::Get(const Anope::string &tag, const Anope::string &def) const { - const Anope::string &str = Get<const Anope::string &>(tag, def); + const Anope::string &str = Get<const Anope::string>(tag, def); return str.equals_ci("yes") || str.equals_ci("on") || str.equals_ci("true"); } @@ -134,8 +128,8 @@ Conf::Conf() : Block("") { Block *include = this->GetBlock("include", i); - const Anope::string &type = include->Get<const Anope::string &>("type"), - &file = include->Get<const Anope::string &>("name"); + const Anope::string &type = include->Get<const Anope::string>("type"), + &file = include->Get<const Anope::string>("name"); File f(file, type == "executable"); this->LoadConf(f); @@ -165,7 +159,7 @@ Conf::Conf() : Block("") }; for (unsigned i = 0; i < sizeof(noreload) / sizeof(noreload[0]); ++i) - if (this->GetBlock(noreload[i].block)->Get<const Anope::string &>(noreload[i].name, noreload[i].def) != Config->GetBlock(noreload[i].block)->Get<const Anope::string &>(noreload[i].name, noreload[i].def)) + if (this->GetBlock(noreload[i].block)->Get<const Anope::string>(noreload[i].name, noreload[i].def) != Config->GetBlock(noreload[i].block)->Get<const Anope::string>(noreload[i].name, noreload[i].def)) throw ConfigException("<" + noreload[i].block + ":" + noreload[i].name + "> can not be modified once set"); } @@ -178,17 +172,17 @@ Conf::Conf() : Block("") ValidateNotZero("options", "warningtimeout", options->Get<time_t>("warningtimeout")); ValidateNotZero("options", "timeoutcheck", options->Get<time_t>("timeoutcheck")); - ValidateNotEmpty("options", "enforceruser", options->Get<const Anope::string &>("enforceruser")); - ValidateNotEmpty("options", "enforcerhost", options->Get<const Anope::string &>("enforcerhost")); - ValidateNotEmpty("options", "guestnickprefix", options->Get<const Anope::string &>("guestnickprefix")); + ValidateNotEmpty("options", "enforceruser", options->Get<const Anope::string>("enforceruser")); + ValidateNotEmpty("options", "enforcerhost", options->Get<const Anope::string>("enforcerhost")); + ValidateNotEmpty("options", "guestnickprefix", options->Get<const Anope::string>("guestnickprefix")); - spacesepstream(options->Get<const Anope::string &>("ulineservers")).GetTokens(this->Ulines); + spacesepstream(options->Get<const Anope::string>("ulineservers")).GetTokens(this->Ulines); if (mail->Get<bool>("usemail")) { Anope::string check[] = { "sendmailpath", "sendfrom", "registration_subject", "registration_message", "emailchange_subject", "emailchange_message", "memo_subject", "memo_message" }; for (unsigned i = 0; i < sizeof(check) / sizeof(Anope::string); ++i) - ValidateNotEmpty("mail", check[i], mail->Get<const Anope::string &>(check[i])); + ValidateNotEmpty("mail", check[i], mail->Get<const Anope::string>(check[i])); } this->ReadTimeout = options->Get<unsigned>("readtimeout"); @@ -196,20 +190,20 @@ Conf::Conf() : Block("") this->StrictPrivmsg = options->Get<bool>("usestrictprivmsg") ? "/msg " : "/"; { std::vector<Anope::string> defaults; - spacesepstream(this->GetModule("nickserv")->Get<const Anope::string &>("defaults")).GetTokens(defaults); + spacesepstream(this->GetModule("nickserv")->Get<const Anope::string>("defaults")).GetTokens(defaults); this->DefPrivmsg = std::find(defaults.begin(), defaults.end(), "msg") != defaults.end(); } - this->DefLanguage = options->Get<const Anope::string &>("defaultlanguage"); + this->DefLanguage = options->Get<const Anope::string>("defaultlanguage"); this->TimeoutCheck = options->Get<time_t>("timeoutcheck"); for (int i = 0; i < this->CountBlock("uplink"); ++i) { Block *uplink = this->GetBlock("uplink", i); - const Anope::string &host = uplink->Get<const Anope::string &>("host"); + const Anope::string &host = uplink->Get<const Anope::string>("host"); bool ipv6 = uplink->Get<bool>("ipv6"); int port = uplink->Get<int>("port"); - const Anope::string &password = uplink->Get<const Anope::string &>("password"); + const Anope::string &password = uplink->Get<const Anope::string>("password"); ValidateNotEmpty("uplink", "host", host); ValidateNotEmpty("uplink", "password", password); @@ -221,7 +215,7 @@ Conf::Conf() : Block("") { Block *module = this->GetBlock("module", i); - const Anope::string &modname = module->Get<const Anope::string &>("name"); + const Anope::string &modname = module->Get<const Anope::string>("name"); ValidateNotEmpty("module", "name", modname); @@ -232,11 +226,11 @@ Conf::Conf() : Block("") { Block *opertype = this->GetBlock("opertype", i); - const Anope::string &oname = opertype->Get<const Anope::string &>("name"), - &modes = opertype->Get<const Anope::string &>("modes"), - &inherits = opertype->Get<const Anope::string &>("inherits"), - &commands = opertype->Get<const Anope::string &>("commands"), - &privs = opertype->Get<const Anope::string &>("privs"); + const Anope::string &oname = opertype->Get<const Anope::string>("name"), + &modes = opertype->Get<const Anope::string>("modes"), + &inherits = opertype->Get<const Anope::string>("inherits"), + &commands = opertype->Get<const Anope::string>("commands"), + &privs = opertype->Get<const Anope::string>("privs"); ValidateNotEmpty("opertype", "name", oname); @@ -277,12 +271,12 @@ Conf::Conf() : Block("") { Block *oper = this->GetBlock("oper", i); - const Anope::string &nname = oper->Get<const Anope::string &>("name"), - &type = oper->Get<const Anope::string &>("type"), - &password = oper->Get<const Anope::string &>("password"), - &certfp = oper->Get<const Anope::string &>("certfp"), - &host = oper->Get<const Anope::string &>("host"), - &vhost = oper->Get<const Anope::string &>("vhost"); + const Anope::string &nname = oper->Get<const Anope::string>("name"), + &type = oper->Get<const Anope::string>("type"), + &password = oper->Get<const Anope::string>("password"), + &certfp = oper->Get<const Anope::string>("certfp"), + &host = oper->Get<const Anope::string>("host"), + &vhost = oper->Get<const Anope::string>("vhost"); bool require_oper = oper->Get<bool>("require_oper"); ValidateNotEmpty("oper", "name", nname); @@ -312,12 +306,12 @@ Conf::Conf() : Block("") { Block *service = this->GetBlock("service", i); - const Anope::string &nick = service->Get<const Anope::string &>("nick"), - &user = service->Get<const Anope::string &>("user"), - &host = service->Get<const Anope::string &>("host"), - &gecos = service->Get<const Anope::string &>("gecos"), - &modes = service->Get<const Anope::string &>("modes"), - &channels = service->Get<const Anope::string &>("channels"); + const Anope::string &nick = service->Get<const Anope::string>("nick"), + &user = service->Get<const Anope::string>("user"), + &host = service->Get<const Anope::string>("host"), + &gecos = service->Get<const Anope::string>("gecos"), + &modes = service->Get<const Anope::string>("modes"), + &channels = service->Get<const Anope::string>("channels"); ValidateNotEmpty("service", "nick", nick); ValidateNotEmpty("service", "user", user); @@ -398,15 +392,15 @@ Conf::Conf() : Block("") LogInfo l(logage, rawio, debug); - spacesepstream(log->Get<const Anope::string &>("target")).GetTokens(l.targets); - spacesepstream(log->Get<const Anope::string &>("source")).GetTokens(l.sources); - spacesepstream(log->Get<const Anope::string &>("admin")).GetTokens(l.admin); - spacesepstream(log->Get<const Anope::string &>("override")).GetTokens(l.override); - spacesepstream(log->Get<const Anope::string &>("commands")).GetTokens(l.commands); - spacesepstream(log->Get<const Anope::string &>("servers")).GetTokens(l.servers); - spacesepstream(log->Get<const Anope::string &>("channels")).GetTokens(l.channels); - spacesepstream(log->Get<const Anope::string &>("users")).GetTokens(l.users); - spacesepstream(log->Get<const Anope::string &>("normal")).GetTokens(l.normal); + spacesepstream(log->Get<const Anope::string>("target")).GetTokens(l.targets); + spacesepstream(log->Get<const Anope::string>("source")).GetTokens(l.sources); + spacesepstream(log->Get<const Anope::string>("admin")).GetTokens(l.admin); + spacesepstream(log->Get<const Anope::string>("override")).GetTokens(l.override); + spacesepstream(log->Get<const Anope::string>("commands")).GetTokens(l.commands); + spacesepstream(log->Get<const Anope::string>("servers")).GetTokens(l.servers); + spacesepstream(log->Get<const Anope::string>("channels")).GetTokens(l.channels); + spacesepstream(log->Get<const Anope::string>("users")).GetTokens(l.users); + spacesepstream(log->Get<const Anope::string>("normal")).GetTokens(l.normal); this->LogInfos.push_back(l); } @@ -417,11 +411,11 @@ Conf::Conf() : Block("") { Block *command = this->GetBlock("command", i); - const Anope::string &service = command->Get<const Anope::string &>("service"), - &nname = command->Get<const Anope::string &>("name"), - &cmd = command->Get<const Anope::string &>("command"), - &permission = command->Get<const Anope::string &>("permission"), - &group = command->Get<const Anope::string &>("group"); + const Anope::string &service = command->Get<const Anope::string>("service"), + &nname = command->Get<const Anope::string>("name"), + &cmd = command->Get<const Anope::string>("command"), + &permission = command->Get<const Anope::string>("permission"), + &group = command->Get<const Anope::string>("group"); bool hide = command->Get<bool>("hide"); ValidateNotEmpty("command", "service", service); @@ -442,8 +436,8 @@ Conf::Conf() : Block("") { Block *privilege = this->GetBlock("privilege", i); - const Anope::string &nname = privilege->Get<const Anope::string &>("name"), - &desc = privilege->Get<const Anope::string &>("desc"); + const Anope::string &nname = privilege->Get<const Anope::string>("name"), + &desc = privilege->Get<const Anope::string>("desc"); int rank = privilege->Get<int>("rank"); PrivilegeManager::AddPrivilege(Privilege(nname, desc, rank)); @@ -453,10 +447,10 @@ Conf::Conf() : Block("") { Block *fantasy = this->GetBlock("fantasy", i); - const Anope::string &nname = fantasy->Get<const Anope::string &>("name"), - &service = fantasy->Get<const Anope::string &>("command"), - &permission = fantasy->Get<const Anope::string &>("permission"), - &group = fantasy->Get<const Anope::string &>("group"); + const Anope::string &nname = fantasy->Get<const Anope::string>("name"), + &service = fantasy->Get<const Anope::string>("command"), + &permission = fantasy->Get<const Anope::string>("permission"), + &group = fantasy->Get<const Anope::string>("group"); bool hide = fantasy->Get<bool>("hide"), prepend_channel = fantasy->Get<bool>("prepend_channel"); @@ -475,8 +469,8 @@ Conf::Conf() : Block("") { Block *command_group = this->GetBlock("command_group", i); - const Anope::string &nname = command_group->Get<const Anope::string &>("name"), - &description = command_group->Get<const Anope::string &>("description"); + const Anope::string &nname = command_group->Get<const Anope::string>("name"), + &description = command_group->Get<const Anope::string>("description"); CommandGroup gr; gr.name = nname; @@ -505,9 +499,9 @@ Conf::Conf() : Block("") Log() << "Tied oper " << na->nc->display << " to type " << o->ot->GetName(); } - if (options->Get<const Anope::string &>("casemap", "ascii") == "ascii") + if (options->Get<const Anope::string>("casemap", "ascii") == "ascii") Anope::casemap = std::locale(std::locale(), new Anope::ascii_ctype<char>()); - else if (options->Get<const Anope::string &>("casemap") == "rfc1459") + else if (options->Get<const Anope::string>("casemap") == "rfc1459") Anope::casemap = std::locale(std::locale(), new Anope::rfc1459_ctype<char>()); else { @@ -517,7 +511,7 @@ Conf::Conf() : Block("") } catch (const std::runtime_error &) { - Log() << "Unknown casemap " << options->Get<const Anope::string &>("casemap") << " - casemap not changed"; + Log() << "Unknown casemap " << options->Get<const Anope::string>("casemap") << " - casemap not changed"; } } Anope::CaseMapRebuild(); @@ -527,27 +521,27 @@ Conf::Conf() : Block("") Log() << "Configuration option options:seed should be set. It's for YOUR safety! Remember that!"; #ifndef _WIN32 - if (!options->Get<const Anope::string &>("user").empty()) + if (!options->Get<const Anope::string>("user").empty()) { errno = 0; struct passwd *u = getpwnam(options->Get<const char *>("user")); if (u == NULL) - Log() << "Unable to setuid to " << options->Get<const Anope::string &>("user") << ": " << Anope::LastError(); + Log() << "Unable to setuid to " << options->Get<const Anope::string>("user") << ": " << Anope::LastError(); else if (setuid(u->pw_uid) == -1) - Log() << "Unable to setuid to " << options->Get<const Anope::string &>("user") << ": " << Anope::LastError(); + Log() << "Unable to setuid to " << options->Get<const Anope::string>("user") << ": " << Anope::LastError(); else - Log() << "Successfully set user to " << options->Get<const Anope::string &>("user"); + Log() << "Successfully set user to " << options->Get<const Anope::string>("user"); } - if (!options->Get<const Anope::string &>("group").empty()) + if (!options->Get<const Anope::string>("group").empty()) { errno = 0; struct group *g = getgrnam(options->Get<const char *>("group")); if (g == NULL) - Log() << "Unable to setgid to " << options->Get<const Anope::string &>("group") << ": " << Anope::LastError(); + Log() << "Unable to setgid to " << options->Get<const Anope::string>("group") << ": " << Anope::LastError(); else if (setuid(g->gr_gid) == -1) - Log() << "Unable to setgid to " << options->Get<const Anope::string &>("group") << ": " << Anope::LastError(); + Log() << "Unable to setgid to " << options->Get<const Anope::string>("group") << ": " << Anope::LastError(); else - Log() << "Successfully set group to " << options->Get<const Anope::string &>("group"); + Log() << "Successfully set group to " << options->Get<const Anope::string>("group"); } #endif @@ -584,7 +578,7 @@ Block *Conf::GetModule(const Anope::string &mname) { Block *b = &iters.first->second; - if (b->Get<const Anope::string &>("name") == mname) + if (b->Get<const Anope::string>("name") == mname) { block = b; break; @@ -835,10 +829,10 @@ void Conf::LoadConf(File &file) { Block *define = this->GetBlock("define", i); - const Anope::string &dname = define->Get<const Anope::string &>("name"); + const Anope::string &dname = define->Get<const Anope::string>("name"); if (dname == wordbuffer) - wordbuffer = define->Get<const Anope::string &>("value"); + wordbuffer = define->Get<const Anope::string>("value"); } if (b) diff --git a/src/init.cpp b/src/init.cpp index 27f0a8689..faa57c18b 100644 --- a/src/init.cpp +++ b/src/init.cpp @@ -216,7 +216,7 @@ static void write_pidfile() atexit(remove_pidfile); } else - throw CoreException("Can not write to PID file " + Config->GetBlock("serverinfo")->Get<const Anope::string &>("pid")); + throw CoreException("Can not write to PID file " + Config->GetBlock("serverinfo")->Get<const Anope::string>("pid")); } void Anope::Init(int ac, char **av) @@ -430,7 +430,7 @@ void Anope::Init(int ac, char **av) /* Create me */ Configuration::Block *block = Config->GetBlock("serverinfo"); - Me = new Server(NULL, block->Get<const Anope::string &>("name"), 0, block->Get<const Anope::string &>("description"), block->Get<const Anope::string &>("id")); + Me = new Server(NULL, block->Get<const Anope::string>("name"), 0, block->Get<const Anope::string>("description"), block->Get<const Anope::string>("id")); for (botinfo_map::const_iterator it = BotListByNick->begin(), it_end = BotListByNick->end(); it != it_end; ++it) { it->second->server = Me; @@ -452,7 +452,7 @@ void Anope::Init(int ac, char **av) /* load modules */ Log() << "Loading modules..."; for (int i = 0; i < Config->CountBlock("module"); ++i) - ModuleManager::LoadModule(Config->GetBlock("module", i)->Get<const Anope::string &>("name"), NULL); + ModuleManager::LoadModule(Config->GetBlock("module", i)->Get<const Anope::string>("name"), NULL); Module *protocol = ModuleManager::FindFirstOf(PROTOCOL); if (protocol == NULL) diff --git a/src/language.cpp b/src/language.cpp index 80f4477c2..aa2c3b2e9 100644 --- a/src/language.cpp +++ b/src/language.cpp @@ -37,7 +37,7 @@ void Language::InitLanguages() setlocale(LC_ALL, ""); - spacesepstream sep(Config->GetBlock("options")->Get<const Anope::string &>("languages")); + spacesepstream sep(Config->GetBlock("options")->Get<const Anope::string>("languages")); Anope::string language; while (sep.GetToken(language)) { diff --git a/src/mail.cpp b/src/mail.cpp index 3b2b1272f..d52089a7a 100644 --- a/src/mail.cpp +++ b/src/mail.cpp @@ -14,7 +14,7 @@ #include "mail.h" #include "config.h" -Mail::Message::Message(const Anope::string &sf, const Anope::string &mailto, const Anope::string &a, const Anope::string &s, const Anope::string &m) : Thread(), sendmail_path(Config->GetBlock("mail")->Get<const Anope::string &>("sendmailpath")), send_from(sf), mail_to(mailto), addr(a), subject(s), message(m), dont_quote_addresses(Config->GetBlock("mail")->Get<bool>("dontquoteaddresses")), success(false) +Mail::Message::Message(const Anope::string &sf, const Anope::string &mailto, const Anope::string &a, const Anope::string &s, const Anope::string &m) : Thread(), sendmail_path(Config->GetBlock("mail")->Get<const Anope::string>("sendmailpath")), send_from(sf), mail_to(mailto), addr(a), subject(s), message(m), dont_quote_addresses(Config->GetBlock("mail")->Get<bool>("dontquoteaddresses")), success(false) { } @@ -60,19 +60,19 @@ bool Mail::Send(User *u, NickCore *nc, const BotInfo *service, const Anope::stri if (!u) { - if (!b->Get<bool>("usemail") || b->Get<const Anope::string &>("sendfrom").empty()) + if (!b->Get<bool>("usemail") || b->Get<const Anope::string>("sendfrom").empty()) return false; else if (nc->email.empty()) return false; nc->lastmail = Anope::CurTime; - Thread *t = new Mail::Message(b->Get<const Anope::string &>("sendfrom"), nc->display, nc->email, subject, message); + Thread *t = new Mail::Message(b->Get<const Anope::string>("sendfrom"), nc->display, nc->email, subject, message); t->Start(); return true; } else { - if (!b->Get<bool>("usemail") || b->Get<const Anope::string &>("sendfrom").empty()) + if (!b->Get<bool>("usemail") || b->Get<const Anope::string>("sendfrom").empty()) u->SendMessage(service, _("Services have been configured to not send mail.")); else if (Anope::CurTime - u->lastmail < b->Get<time_t>("delay")) u->SendMessage(service, _("Please wait \002%d\002 seconds and retry."), b->Get<time_t>("delay") - (Anope::CurTime - u->lastmail)); @@ -81,7 +81,7 @@ bool Mail::Send(User *u, NickCore *nc, const BotInfo *service, const Anope::stri else { u->lastmail = nc->lastmail = Anope::CurTime; - Thread *t = new Mail::Message(b->Get<const Anope::string &>("sendfrom"), nc->display, nc->email, subject, message); + Thread *t = new Mail::Message(b->Get<const Anope::string>("sendfrom"), nc->display, nc->email, subject, message); t->Start(); return true; } @@ -93,11 +93,11 @@ bool Mail::Send(User *u, NickCore *nc, const BotInfo *service, const Anope::stri bool Mail::Send(NickCore *nc, const Anope::string &subject, const Anope::string &message) { Configuration::Block *b = Config->GetBlock("mail"); - if (!b->Get<bool>("usemail") || b->Get<const Anope::string &>("sendfrom").empty() || !nc || nc->email.empty() || subject.empty() || message.empty()) + if (!b->Get<bool>("usemail") || b->Get<const Anope::string>("sendfrom").empty() || !nc || nc->email.empty() || subject.empty() || message.empty()) return false; nc->lastmail = Anope::CurTime; - Thread *t = new Mail::Message(b->Get<const Anope::string &>("sendfrom"), nc->display, nc->email, subject, message); + Thread *t = new Mail::Message(b->Get<const Anope::string>("sendfrom"), nc->display, nc->email, subject, message); t->Start(); return true; diff --git a/src/misc.cpp b/src/misc.cpp index 86328b6b3..29d3a7121 100644 --- a/src/misc.cpp +++ b/src/misc.cpp @@ -382,7 +382,7 @@ bool Anope::Match(const Anope::string &str, const Anope::string &mask, bool case if (r == NULL || r->GetExpression() != stripped_mask) { - ServiceReference<RegexProvider> provider("Regex", Config->GetBlock("options")->Get<const Anope::string &>("regexengine")); + ServiceReference<RegexProvider> provider("Regex", Config->GetBlock("options")->Get<const Anope::string>("regexengine")); if (provider) { try diff --git a/src/nickalias.cpp b/src/nickalias.cpp index 0de2f6d0a..4e7d5b46a 100644 --- a/src/nickalias.cpp +++ b/src/nickalias.cpp @@ -139,8 +139,8 @@ class CoreExport NickServRelease : public User, public Timer * @param na The nick * @param delay The delay before the nick is released */ - NickServRelease(NickAlias *na, time_t delay) : User(na->nick, Config->GetBlock("options")->Get<const Anope::string &>("enforceruser"), - Config->GetBlock("options")->Get<const Anope::string &>("enforcerhost"), "", "", Me, "Services Enforcer", Anope::CurTime, "", Servers::TS6_UID_Retrieve()), Timer(delay), nick(na->nick) + NickServRelease(NickAlias *na, time_t delay) : User(na->nick, Config->GetBlock("options")->Get<const Anope::string>("enforceruser"), + Config->GetBlock("options")->Get<const Anope::string>("enforcerhost"), "", "", Me, "Services Enforcer", Anope::CurTime, "", Servers::TS6_UID_Retrieve()), Timer(delay), nick(na->nick) { /* Erase the current release timer and use the new one */ std::map<Anope::string, NickServRelease *>::iterator nit = NickServReleases.find(this->nick); diff --git a/src/protocol.cpp b/src/protocol.cpp index 14739d24b..052ebd8fc 100644 --- a/src/protocol.cpp +++ b/src/protocol.cpp @@ -349,8 +349,8 @@ bool IRCDProto::IsHostValid(const Anope::string &host) if (host.empty() || host.length() > Config->GetBlock("networkinfo")->Get<unsigned>("hostlen")) return false; - const Anope::string &vhostdisablebe = Config->GetBlock("networkinfo")->Get<const Anope::string &>("disallow_start_or_end"), - vhostchars = Config->GetBlock("networkinfo")->Get<const Anope::string &>("vhost_chars"); + const Anope::string &vhostdisablebe = Config->GetBlock("networkinfo")->Get<const Anope::string>("disallow_start_or_end"), + vhostchars = Config->GetBlock("networkinfo")->Get<const Anope::string>("vhost_chars"); if (vhostdisablebe.find_first_of(host[0]) != Anope::string::npos) return false; diff --git a/src/servers.cpp b/src/servers.cpp index 971ee83d9..6c017f08e 100644 --- a/src/servers.cpp +++ b/src/servers.cpp @@ -377,7 +377,7 @@ const Anope::string Servers::TS6_SID_Retrieve() if (!IRCD || !IRCD->RequiresID) return ""; - static Anope::string current_sid = Config->GetBlock("options")->Get<const Anope::string &>("id"); + static Anope::string current_sid = Config->GetBlock("options")->Get<const Anope::string>("id"); if (current_sid.empty()) current_sid = "00A"; diff --git a/src/uplink.cpp b/src/uplink.cpp index ff90ee53c..dccdbf8fb 100644 --- a/src/uplink.cpp +++ b/src/uplink.cpp @@ -44,8 +44,8 @@ void Uplink::Connect() Configuration::Uplink &u = Config->Uplinks[Anope::CurrentUplink]; new UplinkSocket(); - if (!Config->GetBlock("serverinfo")->Get<const Anope::string &>("localhost").empty()) - UplinkSock->Bind(Config->GetBlock("serverinfo")->Get<const Anope::string &>("localhost")); + if (!Config->GetBlock("serverinfo")->Get<const Anope::string>("localhost").empty()) + UplinkSock->Bind(Config->GetBlock("serverinfo")->Get<const Anope::string>("localhost")); FOREACH_MOD(I_OnPreServerConnect, OnPreServerConnect()); Anope::string ip = Anope::Resolve(u.host, u.ipv6 ? AF_INET6 : AF_INET); Log(LOG_TERMINAL) << "Attempting to connect to uplink #" << (Anope::CurrentUplink + 1) << " " << u.host << " (" << ip << "), port " << u.port; diff --git a/src/users.cpp b/src/users.cpp index 69ecc9eaf..58f586e27 100644 --- a/src/users.cpp +++ b/src/users.cpp @@ -322,7 +322,7 @@ void User::Collide(NickAlias *na) if (IRCD->CanSVSNick) { - const Anope::string &guestprefix = Config->GetBlock("options")->Get<const Anope::string &>("guestnickprefix"); + const Anope::string &guestprefix = Config->GetBlock("options")->Get<const Anope::string>("guestnickprefix"); Anope::string guestnick; diff --git a/src/xline.cpp b/src/xline.cpp index 0ba3d6557..efe19411f 100644 --- a/src/xline.cpp +++ b/src/xline.cpp @@ -25,11 +25,11 @@ Serialize::Checker<std::multimap<Anope::string, XLine *, ci::less> > XLineManage void XLine::InitRegex() { - if (this->mask.length() >= 2 && this->mask[0] == '/' && this->mask[this->mask.length() - 1] == '/' && !Config->GetBlock("options")->Get<const Anope::string &>("regexengine").empty()) + if (this->mask.length() >= 2 && this->mask[0] == '/' && this->mask[this->mask.length() - 1] == '/' && !Config->GetBlock("options")->Get<const Anope::string>("regexengine").empty()) { Anope::string stripped_mask = this->mask.substr(1, this->mask.length() - 2); - ServiceReference<RegexProvider> provider("Regex", Config->GetBlock("options")->Get<const Anope::string &>("regexengine")); + ServiceReference<RegexProvider> provider("Regex", Config->GetBlock("options")->Get<const Anope::string>("regexengine")); if (provider) { try |