summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAdam <Adam@anope.org>2013-05-05 21:18:47 -0400
committerAdam <Adam@anope.org>2013-05-05 21:18:47 -0400
commit3f5f84c92c1a424843b430c60a50efa600ae1236 (patch)
treeae16ada522b5cbed074f8d154d01e8657d195318
parent5b3f81ea78f7a8ab69ff94cbf2bbf07f5966682e (diff)
The const char* specialization of this no longer works
-rw-r--r--include/config.h1
-rw-r--r--modules/commands/bs_set.cpp2
-rw-r--r--modules/commands/cs_list.cpp2
-rw-r--r--modules/commands/ns_register.cpp4
-rw-r--r--modules/commands/ns_resetpass.cpp4
-rw-r--r--modules/commands/ns_set.cpp4
-rw-r--r--modules/pseudoclients/memoserv.cpp4
-rw-r--r--src/config.cpp11
-rw-r--r--src/init.cpp4
-rw-r--r--src/messages.cpp4
10 files changed, 17 insertions, 23 deletions
diff --git a/include/config.h b/include/config.h
index 194b7fe74..82edecca6 100644
--- a/include/config.h
+++ b/include/config.h
@@ -66,7 +66,6 @@ namespace Configuration
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;
/** Represents a configuration file
diff --git a/modules/commands/bs_set.cpp b/modules/commands/bs_set.cpp
index 20a53faf3..95500ac94 100644
--- a/modules/commands/bs_set.cpp
+++ b/modules/commands/bs_set.cpp
@@ -315,7 +315,7 @@ class CommandBSSetFantasy : public Command
"Note that users wanting to use fantaisist\n"
"commands MUST have enough access for both\n"
"the FANTASIA and the command they are executing."),
- Config->GetModule("botserv")->Get<const char *>("fantasycharacter", "!"));
+ Config->GetModule("botserv")->Get<const Anope::string>("fantasycharacter", "!").c_str());
return true;
}
};
diff --git a/modules/commands/cs_list.cpp b/modules/commands/cs_list.cpp
index 9718b73a1..13492c007 100644
--- a/modules/commands/cs_list.cpp
+++ b/modules/commands/cs_list.cpp
@@ -155,7 +155,7 @@ class CommandCSList : public Command
{
source.Reply(" ");
source.Reply(_("Regex matches are also supported using the %s engine.\n"
- "Enclose your pattern in // if this is desired."), Config->GetBlock("options")->Get<const char *>("regexengine"));
+ "Enclose your pattern in // if this is desired."), Config->GetBlock("options")->Get<const Anope::string>("regexengine").c_str());
}
return true;
diff --git a/modules/commands/ns_register.cpp b/modules/commands/ns_register.cpp
index 6da7d4db1..da2f6de59 100644
--- a/modules/commands/ns_register.cpp
+++ b/modules/commands/ns_register.cpp
@@ -373,8 +373,8 @@ static bool SendRegmail(User *u, const NickAlias *na, const BotInfo *bi)
else
codebuf = *code;
- Anope::string subject = Language::Translate(na->nc, Config->GetBlock("mail")->Get<const char *>("registration_subject")),
- message = Language::Translate(na->nc, Config->GetBlock("mail")->Get<const char *>("registration_message"));
+ Anope::string subject = Language::Translate(na->nc, Config->GetBlock("mail")->Get<const Anope::string>("registration_subject").c_str()),
+ message = Language::Translate(na->nc, Config->GetBlock("mail")->Get<const Anope::string>("registration_message").c_str());
subject = subject.replace_all_cs("%n", na->nick);
subject = subject.replace_all_cs("%N", Config->GetBlock("networkinfo")->Get<const Anope::string>("networkname"));
diff --git a/modules/commands/ns_resetpass.cpp b/modules/commands/ns_resetpass.cpp
index 62fa0905f..bf1e8dacf 100644
--- a/modules/commands/ns_resetpass.cpp
+++ b/modules/commands/ns_resetpass.cpp
@@ -139,8 +139,8 @@ static bool SendResetEmail(User *u, const NickAlias *na, const BotInfo *bi)
for (idx = 0; idx < 20; ++idx)
passcode += chars[1 + static_cast<int>((static_cast<float>(max - min)) * static_cast<uint16_t>(rand()) / 65536.0) + min];
- Anope::string subject = Language::Translate(na->nc, Config->GetBlock("mail")->Get<const char *>("reset_subject")),
- message = Language::Translate(na->nc, Config->GetBlock("mail")->Get<const char *>("reset_message"));
+ Anope::string subject = Language::Translate(na->nc, Config->GetBlock("mail")->Get<const Anope::string>("reset_subject").c_str()),
+ message = Language::Translate(na->nc, Config->GetBlock("mail")->Get<const Anope::string>("reset_message").c_str());
subject = subject.replace_all_cs("%n", na->nick);
subject = subject.replace_all_cs("%N", Config->GetBlock("networkinfo")->Get<const Anope::string>("networkname"));
diff --git a/modules/commands/ns_set.cpp b/modules/commands/ns_set.cpp
index f0bff477e..93024b437 100644
--- a/modules/commands/ns_set.cpp
+++ b/modules/commands/ns_set.cpp
@@ -464,8 +464,8 @@ class CommandNSSetEmail : public Command
u->Account()->Extend("ns_set_email_passcode", new ExtensibleItemClass<Anope::string>(code));
- Anope::string subject = Config->GetBlock("mail")->Get<const char *>("emailchange_subject"),
- message = Config->GetBlock("mail")->Get<const char *>("emailchange_message");
+ Anope::string subject = Config->GetBlock("mail")->Get<const Anope::string>("emailchange_subject"),
+ message = Config->GetBlock("mail")->Get<const Anope::string>("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"));
diff --git a/modules/pseudoclients/memoserv.cpp b/modules/pseudoclients/memoserv.cpp
index 13a34137c..1988961cd 100644
--- a/modules/pseudoclients/memoserv.cpp
+++ b/modules/pseudoclients/memoserv.cpp
@@ -15,8 +15,8 @@
static bool SendMemoMail(NickCore *nc, MemoInfo *mi, Memo *m)
{
- Anope::string subject = Language::Translate(nc, Config->GetBlock("mail")->Get<const char *>("memo_subject")),
- message = Language::Translate(Config->GetBlock("mail")->Get<const char *>("memo_message"));
+ Anope::string subject = Language::Translate(nc, Config->GetBlock("mail")->Get<const Anope::string>("memo_subject").c_str()),
+ message = Language::Translate(Config->GetBlock("mail")->Get<const Anope::string>("memo_message").c_str());
subject = subject.replace_all_cs("%n", nc->display);
subject = subject.replace_all_cs("%s", m->sender);
diff --git a/src/config.cpp b/src/config.cpp
index eac2be8c6..17d15a0d9 100644
--- a/src/config.cpp
+++ b/src/config.cpp
@@ -94,11 +94,6 @@ template<> time_t Block::Get(const Anope::string &tag, const Anope::string &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();
-}
-
template<> bool Block::Get(const Anope::string &tag, const Anope::string &def) const
{
const Anope::string &str = Get<const Anope::string>(tag, def);
@@ -507,7 +502,7 @@ Conf::Conf() : Block("")
{
try
{
- Anope::casemap = std::locale(options->Get<const char *>("casemap"));
+ Anope::casemap = std::locale(options->Get<const Anope::string>("casemap").c_str());
}
catch (const std::runtime_error &)
{
@@ -524,7 +519,7 @@ Conf::Conf() : Block("")
if (!options->Get<const Anope::string>("user").empty())
{
errno = 0;
- struct passwd *u = getpwnam(options->Get<const char *>("user"));
+ struct passwd *u = getpwnam(options->Get<const Anope::string>("user").c_str());
if (u == NULL)
Log() << "Unable to setuid to " << options->Get<const Anope::string>("user") << ": " << Anope::LastError();
else if (setuid(u->pw_uid) == -1)
@@ -535,7 +530,7 @@ Conf::Conf() : Block("")
if (!options->Get<const Anope::string>("group").empty())
{
errno = 0;
- struct group *g = getgrnam(options->Get<const char *>("group"));
+ struct group *g = getgrnam(options->Get<const Anope::string>("group").c_str());
if (g == NULL)
Log() << "Unable to setgid to " << options->Get<const Anope::string>("group") << ": " << Anope::LastError();
else if (setuid(g->gr_gid) == -1)
diff --git a/src/init.cpp b/src/init.cpp
index faa57c18b..205fb2501 100644
--- a/src/init.cpp
+++ b/src/init.cpp
@@ -197,14 +197,14 @@ static void InitSignals()
static void remove_pidfile()
{
- remove(Config->GetBlock("serverinfo")->Get<const char *>("pid"));
+ remove(Config->GetBlock("serverinfo")->Get<const Anope::string>("pid").c_str());
}
/* Create our PID file and write the PID to it. */
static void write_pidfile()
{
- FILE *pidfile = fopen(Config->GetBlock("serverinfo")->Get<const char *>("pid"), "w");
+ FILE *pidfile = fopen(Config->GetBlock("serverinfo")->Get<const Anope::string>("pid").c_str(), "w");
if (pidfile)
{
#ifdef _WIN32
diff --git a/src/messages.cpp b/src/messages.cpp
index 9bbfb42c0..ed601a206 100644
--- a/src/messages.cpp
+++ b/src/messages.cpp
@@ -225,7 +225,7 @@ void MOTD::Run(MessageSource &source, const std::vector<Anope::string> &params)
if (s != Me)
return;
- FILE *f = fopen(Config->GetBlock("serverinfo")->Get<const char *>("motd"), "r");
+ FILE *f = fopen(Config->GetBlock("serverinfo")->Get<const Anope::string>("motd").c_str(), "r");
if (f)
{
IRCD->SendNumeric(375, source.GetSource(), ":- %s Message of the Day", s->GetName().c_str());
@@ -454,7 +454,7 @@ void Whois::Run(MessageSource &source, const std::vector<Anope::string> &params)
IRCD->SendNumeric(311, source.GetSource(), "%s %s %s * :%s", u->nick.c_str(), u->GetIdent().c_str(), u->host.c_str(), u->realname.c_str());
if (bi)
IRCD->SendNumeric(307, source.GetSource(), "%s :is a registered nick", bi->nick.c_str());
- IRCD->SendNumeric(312, source.GetSource(), "%s %s :%s", u->nick.c_str(), Me->GetName().c_str(), Config->GetBlock("serverinfo")->Get<const char *>("description"));
+ IRCD->SendNumeric(312, source.GetSource(), "%s %s :%s", u->nick.c_str(), Me->GetName().c_str(), Config->GetBlock("serverinfo")->Get<const Anope::string>("description").c_str());
if (bi)
IRCD->SendNumeric(317, source.GetSource(), "%s %ld %ld :seconds idle, signon time", bi->nick.c_str(), static_cast<long>(Anope::CurTime - bi->lastmsg), static_cast<long>(bi->signon));
IRCD->SendNumeric(318, source.GetSource(), "%s :End of /WHOIS list.", params[0].c_str());