comparison OrthancServer/Sources/OrthancConfiguration.cpp @ 5643:b1a18218860c

2 new configurations: DicomTlsMinimumProtocolVersion + DicomTlsCiphersAccepted
author Alain Mazy <am@orthanc.team>
date Fri, 31 May 2024 16:56:35 +0200
parents f7adfb22e20e
children 078b724dcbf8
comparison
equal deleted inserted replaced
5642:95e282478cda 5643:b1a18218860c
749 749
750 const Json::Value& lst = json_[key]; 750 const Json::Value& lst = json_[key];
751 751
752 if (lst.type() != Json::arrayValue) 752 if (lst.type() != Json::arrayValue)
753 { 753 {
754 throw OrthancException(ErrorCode_BadFileFormat, "Badly formatted list of strings"); 754 throw OrthancException(ErrorCode_BadFileFormat, "Badly formatted list of strings: " + key);
755 } 755 }
756 756
757 for (Json::Value::ArrayIndex i = 0; i < lst.size(); i++) 757 for (Json::Value::ArrayIndex i = 0; i < lst.size(); i++)
758 { 758 {
759 target.push_back(lst[i].asString()); 759 target.push_back(lst[i].asString());
760 } 760 }
761 } 761 }
762 762
763 763
764 void OrthancConfiguration::GetSetOfStringsParameter(std::set<std::string>& target,
765 const std::string& key) const
766 {
767 target.clear();
768
769 if (!json_.isMember(key))
770 {
771 return;
772 }
773
774 const Json::Value& lst = json_[key];
775
776 if (lst.type() != Json::arrayValue)
777 {
778 throw OrthancException(ErrorCode_BadFileFormat, "Badly formatted set of strings: " + key);
779 }
780
781 for (Json::Value::ArrayIndex i = 0; i < lst.size(); i++)
782 {
783 target.insert(lst[i].asString());
784 }
785 }
786
787
764 bool OrthancConfiguration::IsSameAETitle(const std::string& aet1, 788 bool OrthancConfiguration::IsSameAETitle(const std::string& aet1,
765 const std::string& aet2) const 789 const std::string& aet2) const
766 { 790 {
767 if (GetBooleanParameter("StrictAetComparison", false)) 791 if (GetBooleanParameter("StrictAetComparison", false))
768 { 792 {