comparison OrthancServer/OrthancInitialization.cpp @ 2069:fabf7820d1f1

New configuration options: "DicomScuTimeout" and "DicomScpTimeout" + validation of non-negative options
author Sebastien Jodogne <s.jodogne@gmail.com>
date Wed, 13 Jul 2016 16:52:39 +0200
parents fefbe71c2272
children 27fd34970c52
comparison
equal deleted inserted replaced
2068:879f3be759ef 2069:fabf7820d1f1
575 return defaultValue; 575 return defaultValue;
576 } 576 }
577 } 577 }
578 578
579 579
580 unsigned int Configuration::GetGlobalUnsignedIntegerParameter(const std::string& parameter,
581 unsigned int defaultValue)
582 {
583 int v = GetGlobalIntegerParameter(parameter, defaultValue);
584
585 if (v < 0)
586 {
587 LOG(ERROR) << "The configuration option \"" << parameter << "\" must be a positive integer";
588 throw OrthancException(ErrorCode_BadParameterType);
589 }
590 else
591 {
592 return static_cast<unsigned int>(v);
593 }
594 }
595
596
580 bool Configuration::GetGlobalBoolParameter(const std::string& parameter, 597 bool Configuration::GetGlobalBoolParameter(const std::string& parameter,
581 bool defaultValue) 598 bool defaultValue)
582 { 599 {
583 boost::recursive_mutex::scoped_lock lock(globalMutex_); 600 boost::recursive_mutex::scoped_lock lock(globalMutex_);
584 return GetGlobalBoolParameterInternal(parameter, defaultValue); 601 return GetGlobalBoolParameterInternal(parameter, defaultValue);