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
------------------
Branch: ni/coolstream
Commit: ad498249d1
Author: Christian Schuett <Gaucho316@hotmail.com>
Date: 2014-06-23 (Mon, 23 Jun 2014)



------------------
This commit was generated by Migit
This commit is contained in:
Christian Schuett
2014-06-23 21:37:49 +02:00
committed by vanhofen
parent 373dbba059
commit 74e4c812c2

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());
}
@@ -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());
}