From 74e4c812c27039d94a2a76b829a1fadd4ec229d0 Mon Sep 17 00:00:00 2001 From: Christian Schuett Date: Mon, 23 Jun 2014 21:37:49 +0200 Subject: [PATCH] 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 in Neutrino-MP Git Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/ad498249d1baa7c469631833e23a919bd154ee04 Author: Christian Schuett Date: 2014-06-23 (Mon, 23 Jun 2014) ------------------ This commit was generated by Migit --- lib/libconfigfile/configfile.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/lib/libconfigfile/configfile.cpp b/lib/libconfigfile/configfile.cpp index 651562335..38517d8dc 100644 --- a/lib/libconfigfile/configfile.cpp +++ b/lib/libconfigfile/configfile.cpp @@ -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()); }