diff options
Diffstat (limited to 'src/configreader.cpp')
| -rw-r--r-- | src/configreader.cpp | 30 |
1 files changed, 15 insertions, 15 deletions
diff --git a/src/configreader.cpp b/src/configreader.cpp index fc9a7cb28..9e17b34be 100644 --- a/src/configreader.cpp +++ b/src/configreader.cpp @@ -25,42 +25,42 @@ ConfigReader::~ConfigReader() delete this->data; } -ConfigReader::ConfigReader(const std::string &filename) : data(new ConfigDataHash), errorlog(new std::ostringstream(std::stringstream::in | std::stringstream::out)), privatehash(true), error(CONF_NO_ERROR) +ConfigReader::ConfigReader(const Anope::string &filename) : data(new ConfigDataHash), errorlog(new std::ostringstream(std::stringstream::in | std::stringstream::out)), privatehash(true), error(CONF_NO_ERROR) { Config.ClearStack(); } -std::string ConfigReader::ReadValue(const std::string &tag, const std::string &name, const std::string &default_value, int index, bool allow_linefeeds) +Anope::string ConfigReader::ReadValue(const Anope::string &tag, const Anope::string &name, const Anope::string &default_value, int index, bool allow_linefeeds) { /* Don't need to strlcpy() tag and name anymore, ReadConf() takes const char* */ - ci::string result; + Anope::string result; - if (!Config.ConfValue(*this->data, ci::string(tag.c_str()), ci::string(name.c_str()), ci::string(default_value.c_str()), index, result, allow_linefeeds)) + if (!Config.ConfValue(*this->data, tag, name, default_value, index, result, allow_linefeeds)) this->error = CONF_VALUE_NOT_FOUND; - return result.c_str(); + return result; } -std::string ConfigReader::ReadValue(const std::string &tag, const std::string &name, int index, bool allow_linefeeds) +Anope::string ConfigReader::ReadValue(const Anope::string &tag, const Anope::string &name, int index, bool allow_linefeeds) { return ReadValue(tag, name, "", index, allow_linefeeds); } -bool ConfigReader::ReadFlag(const std::string &tag, const std::string &name, const std::string &default_value, int index) +bool ConfigReader::ReadFlag(const Anope::string &tag, const Anope::string &name, const Anope::string &default_value, int index) { - return Config.ConfValueBool(*this->data, ci::string(tag.c_str()), ci::string(name.c_str()), ci::string(default_value.c_str()), index); + return Config.ConfValueBool(*this->data, tag, name, default_value, index); } -bool ConfigReader::ReadFlag(const std::string &tag, const std::string &name, int index) +bool ConfigReader::ReadFlag(const Anope::string &tag, const Anope::string &name, int index) { return ReadFlag(tag, name, "", index); } -int ConfigReader::ReadInteger(const std::string &tag, const std::string &name, const std::string &default_value, int index, bool need_positive) +int ConfigReader::ReadInteger(const Anope::string &tag, const Anope::string &name, const Anope::string &default_value, int index, bool need_positive) { int result; - if (!Config.ConfValueInteger(*this->data, ci::string(tag.c_str()), ci::string(name.c_str()), ci::string(default_value.c_str()), index, result)) + if (!Config.ConfValueInteger(*this->data, tag, name, default_value, index, result)) { this->error = CONF_VALUE_NOT_FOUND; return 0; @@ -75,7 +75,7 @@ int ConfigReader::ReadInteger(const std::string &tag, const std::string &name, c return result; } -int ConfigReader::ReadInteger(const std::string &tag, const std::string &name, int index, bool need_positive) +int ConfigReader::ReadInteger(const Anope::string &tag, const Anope::string &name, int index, bool need_positive) { return ReadInteger(tag, name, "", index, need_positive); } @@ -92,14 +92,14 @@ void ConfigReader::DumpErrors(bool bail) Config.ReportConfigError(this->errorlog->str(), bail); } -int ConfigReader::Enumerate(const std::string &tag) +int ConfigReader::Enumerate(const Anope::string &tag) { return Config.ConfValueEnum(*this->data, tag); } -int ConfigReader::EnumerateValues(const std::string &tag, int index) +int ConfigReader::EnumerateValues(const Anope::string &tag, int index) { - return Config.ConfVarEnum(*this->data, ci::string(tag.c_str()), index); + return Config.ConfVarEnum(*this->data, tag, index); } bool ConfigReader::Verify() |
