-ConfigReader::ConfigReader(InspIRCd* Instance)
-{
- this->error = 0;
-}
-
-
-ConfigReader::~ConfigReader()
-{
-}
-
-
-std::string ConfigReader::ReadValue(const std::string &tag, const std::string &name, const std::string &default_value, int index, bool allow_linefeeds)
-{
- /* Don't need to strlcpy() tag and name anymore, ReadConf() takes const char* */
- std::string result;
-
- if (!ServerInstance->Config->ConfValue(tag, name, default_value, index, 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)
-{
- return ServerInstance->Config->ConfValueBool(tag, name, default_value, index);
-}
-
-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 result;
-
- if(!ServerInstance->Config->ConfValueInteger(tag, name, default_value, index, result))
- {
- this->error = CONF_VALUE_NOT_FOUND;
- return 0;
- }
-
- 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;
-}
-
-int ConfigReader::Enumerate(const std::string &tag)
-{
- return ServerInstance->Config->ConfValueEnum(tag);
-}
-
-int ConfigReader::EnumerateValues(const std::string &tag, int index)
-{
- return ServerInstance->Config->ConfVarEnum(tag, index);
-}
-
-FileReader::FileReader(InspIRCd* Instance, const std::string &filename)