diff options
| author | 2010-08-21 16:27:31 -0400 | |
|---|---|---|
| committer | 2010-08-21 16:27:31 -0400 | |
| commit | 37d282776753c7fd6a6793dd40105e89fdf47f62 (patch) | |
| tree | 53665acd614d3944955ef0878ecbe21677fffef3 /src/modules.cpp | |
| parent | Add per-user registration limit to m_chanregister (diff) | |
Remove ConfigReader (deprecated interface)
Diffstat (limited to 'src/modules.cpp')
| -rw-r--r-- | src/modules.cpp | 78 |
1 files changed, 0 insertions, 78 deletions
diff --git a/src/modules.cpp b/src/modules.cpp index 7fc9e93b1..894b8c477 100644 --- a/src/modules.cpp +++ b/src/modules.cpp @@ -758,84 +758,6 @@ const std::vector<std::string> ModuleManager::GetAllModuleNames(int filter) return retval; } -ConfigReader::ConfigReader() -{ - this->error = 0; - ServerInstance->Logs->Log("MODULE", DEBUG, "ConfigReader is deprecated in 2.0; " - "use ServerInstance->Config->ConfValue(\"key\") or ->ConfTags(\"key\") instead"); -} - - -ConfigReader::~ConfigReader() -{ -} - -static ConfigTag* SlowGetTag(const std::string &tag, int index) -{ - ConfigTagList tags = ServerInstance->Config->ConfTags(tag); - while (tags.first != tags.second) - { - if (!index) - return tags.first->second; - tags.first++; - index--; - } - return NULL; -} - -std::string ConfigReader::ReadValue(const std::string &tag, const std::string &name, const std::string &default_value, int index, bool allow_linefeeds) -{ - std::string result = default_value; - if (!SlowGetTag(tag, index)->readString(name, result, allow_linefeeds)) - { - this->error = CONF_VALUE_NOT_FOUND; - } - return result; -} - -std::string ConfigReader::ReadValue(const std::string &tag, const std::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 def = (default_value == "yes"); - return SlowGetTag(tag, index)->getBool(name, def); -} - -bool ConfigReader::ReadFlag(const std::string &tag, const std::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 v = atoi(default_value.c_str()); - int result = SlowGetTag(tag, index)->getInt(name, v); - - if ((need_positive) && (result < 0)) - { - this->error = CONF_INT_NEGATIVE; - return 0; - } - - return result; -} - -int ConfigReader::ReadInteger(const std::string &tag, const std::string &name, int index, bool need_positive) -{ - return ReadInteger(tag, name, "", index, need_positive); -} - -long ConfigReader::GetError() -{ - long olderr = this->error; - this->error = 0; - return olderr; -} - FileReader::FileReader(const std::string &filename) { LoadFile(filename); |
