comparison OrthancServer/OrthancConfiguration.cpp @ 3939:c205f670098e transcoding

new configuration options: BuiltinDecoderTranscoderOrder and IngestTranscoding
author Sebastien Jodogne <s.jodogne@gmail.com>
date Mon, 18 May 2020 17:15:16 +0200
parents 1f4910999fe7
children e3b3af80732d
comparison
equal deleted inserted replaced
3938:54dbebbcc032 3939:c205f670098e
420 static OrthancConfiguration configuration; 420 static OrthancConfiguration configuration;
421 return configuration; 421 return configuration;
422 } 422 }
423 423
424 424
425 bool OrthancConfiguration::LookupStringParameter(std::string& target,
426 const std::string& parameter) const
427 {
428 if (json_.isMember(parameter))
429 {
430 if (json_[parameter].type() != Json::stringValue)
431 {
432 throw OrthancException(ErrorCode_BadParameterType,
433 "The configuration option \"" + parameter + "\" must be a string");
434 }
435 else
436 {
437 target = json_[parameter].asString();
438 return true;
439 }
440 }
441 else
442 {
443 return false;
444 }
445 }
446
447
425 std::string OrthancConfiguration::GetStringParameter(const std::string& parameter, 448 std::string OrthancConfiguration::GetStringParameter(const std::string& parameter,
426 const std::string& defaultValue) const 449 const std::string& defaultValue) const
427 { 450 {
428 if (json_.isMember(parameter)) 451 std::string value;
429 { 452 if (LookupStringParameter(value, parameter))
430 if (json_[parameter].type() != Json::stringValue) 453 {
431 { 454 return value;
432 throw OrthancException(ErrorCode_BadParameterType,
433 "The configuration option \"" + parameter + "\" must be a string");
434 }
435 else
436 {
437 return json_[parameter].asString();
438 }
439 } 455 }
440 else 456 else
441 { 457 {
442 return defaultValue; 458 return defaultValue;
443 } 459 }