Mercurial > hg > orthanc
diff OrthancServer/OrthancConfiguration.cpp @ 3506:d2b9981017c4
better handling of HTTP security
author | Sebastien Jodogne <s.jodogne@gmail.com> |
---|---|
date | Wed, 28 Aug 2019 15:19:04 +0200 |
parents | 0d248cc63ded |
children | 41365091a41e |
line wrap: on
line diff
--- a/OrthancServer/OrthancConfiguration.cpp Wed Aug 28 12:21:23 2019 +0200 +++ b/OrthancServer/OrthancConfiguration.cpp Wed Aug 28 15:19:04 2019 +0200 @@ -484,8 +484,8 @@ } - bool OrthancConfiguration::GetBooleanParameter(const std::string& parameter, - bool defaultValue) const + bool OrthancConfiguration::LookupBooleanParameter(bool& target, + const std::string& parameter) const { if (json_.isMember(parameter)) { @@ -497,11 +497,27 @@ } else { - return json_[parameter].asBool(); + target = json_[parameter].asBool(); + return true; } } else { + return false; + } + } + + + bool OrthancConfiguration::GetBooleanParameter(const std::string& parameter, + bool defaultValue) const + { + bool value; + if (LookupBooleanParameter(value, parameter)) + { + return value; + } + else + { return defaultValue; } }