libconfigfile: accept booleans as int32 or int64

for compatibility if config file entry is changed from boolean to int32 or int64

based on patch by martii <m4rtii@gmx.de> in Neutrino-MP Git


Origin commit data
------------------
Commit: ad498249d1
Author: Gaucho316 <Gaucho316@hotmail.com>
Date: 2014-06-23 (Mon, 23 Jun 2014)
This commit is contained in:
Gaucho316
2014-06-23 21:37:49 +02:00
committed by vanhofen
parent 5c9adb6180
commit ba18d5fe7a

View File

@@ -204,6 +204,10 @@ int32_t CConfigFile::getInt32(const std::string & key, const int32_t defaultVal)
} }
} }
if (configData[key] == "false")
return 0;
if (configData[key] == "true")
return 1;
return atoi(configData[key].c_str()); return atoi(configData[key].c_str());
} }
@@ -225,6 +229,10 @@ int64_t CConfigFile::getInt64(const std::string & key, const int64_t defaultVal)
} }
} }
if (configData[key] == "false")
return 0;
if (configData[key] == "true")
return 1;
return atoll(configData[key].c_str()); return atoll(configData[key].c_str());
} }