summaryrefslogtreecommitdiff
path: root/src/configreader.cpp
diff options
context:
space:
mode:
authorAdam <Adam@anope.org>2013-04-11 00:08:28 -0500
committerAdam <Adam@anope.org>2013-04-11 00:08:28 -0500
commit4f9b7874d6b3a41939ecc2e872ec08d03af7b5f1 (patch)
tree43162205d31b277c9ff12ee28b7e3a60d6382316 /src/configreader.cpp
parent207c46c871e85b55ae66acc456c6bc412c0c79f9 (diff)
Pass new config and the new config reader to the OnReload event, aswell as call it on module load on modules that hook to it
Diffstat (limited to 'src/configreader.cpp')
-rw-r--r--src/configreader.cpp18
1 files changed, 11 insertions, 7 deletions
diff --git a/src/configreader.cpp b/src/configreader.cpp
index 64b4addf4..ca5a64a60 100644
--- a/src/configreader.cpp
+++ b/src/configreader.cpp
@@ -27,11 +27,15 @@
#include "services.h"
#include "config.h"
-ConfigReader::ConfigReader() : error(CONF_NO_ERROR)
+ConfigReader::ConfigReader() : conf(Config), error(CONF_NO_ERROR)
{
}
-ConfigReader::ConfigReader(const Anope::string &filename) : error(CONF_NO_ERROR)
+ConfigReader::ConfigReader(const Anope::string &filename) : conf(Config), error(CONF_NO_ERROR)
+{
+}
+
+ConfigReader::ConfigReader(ServerConfig *c) : conf(c), error(CONF_NO_ERROR)
{
}
@@ -44,7 +48,7 @@ Anope::string ConfigReader::ReadValue(const Anope::string &tag, const Anope::str
/* Don't need to strlcpy() tag and name anymore, ReadConf() takes const char* */
Anope::string result;
- if (!Config->ConfValue(Config->config_data, tag, name, default_value, index, result, allow_linefeeds))
+ if (!conf->ConfValue(conf->config_data, tag, name, default_value, index, result, allow_linefeeds))
this->error = CONF_VALUE_NOT_FOUND;
return result;
@@ -57,7 +61,7 @@ Anope::string ConfigReader::ReadValue(const Anope::string &tag, const Anope::str
bool ConfigReader::ReadFlag(const Anope::string &tag, const Anope::string &name, const Anope::string &default_value, int index)
{
- return Config->ConfValueBool(Config->config_data, tag, name, default_value, index);
+ return conf->ConfValueBool(conf->config_data, tag, name, default_value, index);
}
bool ConfigReader::ReadFlag(const Anope::string &tag, const Anope::string &name, int index)
@@ -69,7 +73,7 @@ int ConfigReader::ReadInteger(const Anope::string &tag, const Anope::string &nam
{
int result;
- if (!Config->ConfValueInteger(Config->config_data, tag, name, default_value, index, result))
+ if (!conf->ConfValueInteger(conf->config_data, tag, name, default_value, index, result))
{
this->error = CONF_VALUE_NOT_FOUND;
return 0;
@@ -98,12 +102,12 @@ long ConfigReader::GetError()
int ConfigReader::Enumerate(const Anope::string &tag) const
{
- return Config->ConfValueEnum(Config->config_data, tag);
+ return conf->ConfValueEnum(conf->config_data, tag);
}
int ConfigReader::EnumerateValues(const Anope::string &tag, int index)
{
- return Config->ConfVarEnum(Config->config_data, tag, index);
+ return conf->ConfVarEnum(conf->config_data, tag, index);
}
bool ConfigReader::Verify()