Mercurial > hg > orthanc
diff OrthancServer/OrthancConfiguration.cpp @ 3956:6e14f2da7c7e
integration transcoding->mainline
author | Sebastien Jodogne <s.jodogne@gmail.com> |
---|---|
date | Wed, 20 May 2020 16:42:44 +0200 |
parents | c205f670098e |
children | e3b3af80732d |
line wrap: on
line diff
--- a/OrthancServer/OrthancConfiguration.cpp Wed May 06 08:40:48 2020 +0200 +++ b/OrthancServer/OrthancConfiguration.cpp Wed May 20 16:42:44 2020 +0200 @@ -422,8 +422,8 @@ } - std::string OrthancConfiguration::GetStringParameter(const std::string& parameter, - const std::string& defaultValue) const + bool OrthancConfiguration::LookupStringParameter(std::string& target, + const std::string& parameter) const { if (json_.isMember(parameter)) { @@ -434,11 +434,27 @@ } else { - return json_[parameter].asString(); + target = json_[parameter].asString(); + return true; } } else { + return false; + } + } + + + std::string OrthancConfiguration::GetStringParameter(const std::string& parameter, + const std::string& defaultValue) const + { + std::string value; + if (LookupStringParameter(value, parameter)) + { + return value; + } + else + { return defaultValue; } }